Are there any useful tools for diagnosing Qt layout and spacing problems?

后端 未结 4 2101

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

相关标签:
4条回答
  • 2021-02-05 06:05

    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

    0 讨论(0)
  • 2021-02-05 06:12

    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.

    0 讨论(0)
  • 2021-02-05 06:25

    Late, but QObject::dumpObjectTree() helped me solve my issues.

    Dumps a tree of children to the debug output.

    0 讨论(0)
  • 2021-02-05 06:28

    Could you use a QHoverEvent to add a dark border or a popup with an id every time you hover over an element?

    0 讨论(0)
提交回复
热议问题