tags:

views:

61

answers:

1

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 particular widget and I'm traversing the children() hierarchy by hand. There's got to be a better way!

A: 

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

Kaleb Pederson
Be sure to use `setObjectName` for this to work correctly.
Adam W