i working on project using pyqt5, , using several windows dynamically change widgets, depending on data supply.
for purposes of debugging, possible view object structure of window running? using qt designer design many of windows, contents change while program running, qt creator cannot show me structure of windows @ times in program.
is possible view object hierarchy, such in object inspector in qt creator? or perhaps possible make invisible widgets, layouts , spacers, visible while running?
i don't know if it's possible in qt creator while application running, can insert statements source code print out entire object hierarchy. pick base object , recursively print output of qwidget.children()
.
one problem when print neither miss newly-added widgets nor overwhelm terminal (so timer not best idea). if application responds data supply calling specific slot or function, seems points @ tree changes, perfect time this. can start qapplication
object, , walk tree down there.
if don't respond data way, there more involved ok solution. can instead intercept qchildevent
s , print new object hierarchy @ point. can done installing filter object on root object you're interested in it's created, install on new children. print full object tree, starting root. check out this answer more details on how create kind of filter object. it's in c++, code should straightforward translate python.
Comments
Post a Comment