Is there something like .NET Reflector for Qt? - 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 tool 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

Related

Qt6 circular gauge issue

I am developing a qml app in qt5 with circular gauge. I want to port application qt 6. But in qt 6 qtquick extras is missing, so circular gauge is not available. Is qt planning to make it available in next releases of qt6? What can I do instead of using circular gauge in qt6?
Is there anyone who knows about it?
As far as I know there are no plans yet to port it to Qt 6. You could create a suggestion on Jira to express your interest in having it.
The code is here and here if you want to try to port it yourself or just use parts of it (keeping in mind the license, which is LGPL).
As you stated in the question, CircularGauge is not available in Qt6. So what can you do?
As a minimal effort, you can substitute CircularGauge with a functional similar component, for instance, RangeSlider. Of course, a RangeSlider looks nothing like a CircularGauge, but, it will, at least, allow you to compile and run your application. It will give you an application to test whilst you decide your options.
Then, as others have stated, you need to spend more effort allocated to porting. If you refer to the source code of CircularGauge, you see that they're using Canvas with a custom onPaint implementation. You could do the same in your port, or, you can find an alternative, e.g. Shape with ShapePath, etc. These efforts are non-trivial, and it boils down to the level of effort you wish to invest.

How to support multiple language in Qt Based Application

I am trying to develop a Qml based QT application which will support multiple languages.In the application there will be drop down list from where on select of language whole language family of the application will be changed.Can anyone help me on that giving idea how to proceed?
Is there any example? and is QTranslator() is the convenient way to do this?
The localization system of Qt is well documented: Internationalization with Qt
Simply you put your text directly in the C++ code, using the tr() method of QObject (or qsTr() in QML). Than there are some tools (lupdate and lrelease) to generate the translation files. I suggest to read the documentation, it's very easy.
Some useful links:
Hello tr: and example
Qt Linguist manual
QTranslator works well with Qt UI as you can use languageChanged() signal to update the UI. This isn't possible with QML.
See this QML WiKi, it is the recommended workaround (for now!).

How to Interact with a Qt C++ library inside a QML/QtQuick application?

I recently wrote a Qt based library to manage requests to TheMovieDB.org for a professional desktop application.
Not really experienced with QML and QtQuick, I think about migrating this application to QML which seems to be really adapted for.
I began few tutorials with QML...Amazing.
And now, I wonder if I can integrage my wrapper library into a QML application ?
Basically, let the user capture a movie name into a nice QML interface, froward the input parameters to the c++ wrapper, and retrieve the resulting json results + QPixmap object.
Is it something possible ? I found some piece of codes to access QML components from a Qt c++ application but the inverse yet.
Or maybe am I thinking the things the wrong way ?
Have you ever wrote something similar, I mean regarding the interaction mechanism?

How does Qt's model/view implementation work in the background?

I want to find some information about Model/View's implementation, but it's not documented.
By the way, I don't want information about how to use Model/View, what I want to know is its procedures, such as which function is called when, etc.
Investigate this yourself. You can
look at the source code
use an interactive debugger
write some code to try to intercept the signals and slots (I believe there's something built into Designer)
use a Qt-specific tool to look at the live objects like Qt Inspector
http://doc.qt.nokia.com/4.7-snapshot/model-view-programming.html

Checkstyle for ActionScript (Flex)

HI,
I'm currently working on a project that uses Flex and Java. In Java we easily enforced a coding standard with Checkstyle, and we want to do this for Flex.
Does anybody know of a tool similar to Checkstyle that would allow coding standard checks?
(I've googled for this but found only one project written in python and it seams abandoned)
Thanks
The long and the short is that there is... kind of, but only for Actionscript, and you have to test it yourself... There is a prototype of an Actionscript 3 version, but it is not even in Beta yet (and I admit that I haven't had the time to test it). I haven't found anything similar for XML, let alone MXML. This is in at least one list of feature requests for Flex 4, however.
I'm working too on a project uses Flex and Java. Like you, in Java, we easily use plugins like checkstyle, findBug, javaNcss or PMD. My personal project is to do this for Flex. I have test the prototype 'checkStyleas3' but it just verify the code source en returns you 0 or -1 as result. So you will have (me too in fact), to implement this prototype if you want to do more than that.
Keep an eye on this : http://blog.joa-ebert.com/2009/05/20/as3v-preview/

Resources