Is there a Qt widget to browse the hierarchy of widgets in an app (similar to Spy++)?

早过忘川 提交于 2019-12-05 18:24:19

you can use Gammaray for spy Widget and signal slot and timers and resource and etc. Gammaray is very powerfull tool for spy Qt Application

The usual approach is to build such a beast in-house, using the introspection APIs, and walking the QWidget parent-child hierarchy. It's pretty easy to build a basic one; if you want to build a full property editor it's considerably more work. There's probably code you can re-use to reduce the work - possibly even the property inspector code from Designer, though it might be overkill. I've never gone as far as full GUI, due to time constraints - I've simply dumped the hierarchy and some fixed properties to stdout as text or XML.

I suppose it would be plausible to make a reusable GUI component out of this, that could be dropped into an arbitrary app, would look for top-level widgets, and allow everything to be inspected, if you have the time and inclination.

Not a browser, but useful in debugging...

void QObject::dumpObjectTree() const

Dumps a tree of children to the debug output.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!