See also related question: How do you debug Qt layout problems
I\'ve got some complex widget hierarchies that I\'m trying to lay out, and I run into the usual p
I had a related follow-on question in another thread to which Dmitry came up with a great method that led to a good solution: Drawing an overlay on top of an application's window
EDIT: I've also found a useful technique hidden away in the documentation of QLayout::itemAt() which shows how to iterate through the QLayoutItems
in a layout and draw their rectangles
What you are looking for is basically a tool that analyzes the QObject or rather QWidget hierarchy and adds annotations. This is exactly what GammaRay is about. It is GPL licensed and therefore freely available. You can get further infos on the GammaRay project page. I've used it several times, and it works as expected.
Late, but QObject::dumpObjectTree() helped me solve my issues.
Dumps a tree of children to the debug output.
Could you use a QHoverEvent to add a dark border or a popup with an id every time you hover over an element?