开发者

PyQT: get recursive children of a widget

Anyone have a slick function that will return a nested tree of all the children of a particular widget?

I'm familiar with dumpObjectTree() but I'm not able to compile in debug mode, so I don't have access to that function.

Trying to find a pa开发者_开发知识库rticular widget and I'm traversing the children() hierarchy by hand. There's got to be a better way!


QObject.findChild (or findChildren) will recursively search for a child and should do what you need.


I found that a QObject has a dumpObjectTree method at this link. Is that what you're looking for?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜