Is there something like .NET Reflector for Qt?
Once I've seen a nice tool called .NET Reflector. It can show the entire object hierarchy of .Net binaries/apps (sorry if the term is wrong). Is there something like this for Qt? As Qt has very good QMetaObject abilities, it should be possible to traverse object-trees, call methods(slots), change properties, etc.
I am currently re-factoring a Qt project. The naming of variables is very domain specific and I am not the expert in this domain. So, it is difficult for me to map a widget-variable to the widget on the screen. Such t开发者_开发百科ool would be a great help for me to understand the code.
Thank you very much in advance!
For simple uses you might want to take a look at QObject::dumpObjectTree()
If you need something more advanced there's kspy
kspy: examines the internal state of a Qt/KDE app KSpy is a tiny library which can be used to graphically display the QObjects in use by a Qt/KDE app. In addition to the object tree, you can also view the properties, signals and slots of any QObject. Basically it provides much the same info as QObject::dumpObjectTree() and QObject::dumpObjectInfo(), but in a much more convenient form. KSpy has minimal overhead for the application, because the kspy library is loaded dynamically using KLibLoader. See /usr /share/doc/kspy/README for usage instructions. This package is part of the KDE Software Development Kit.
It depends on KDE's klibloader so if you are not under KDE you have to modify it but it should be rather easy. Sources are here.
There's QSpy project. It inspects all QWidgets of running application. I'm not sure how well it works, because I couldn't use it on Mac OS X. Maybe on Windows it works better. https://github.com/sashao/martlet http://qt-apps.org/content/show.php/QSpy?content=102287
精彩评论