Tips and tricks for 'backtracing' UI elements into the code.
-
Hi,
OK making a UI with Qt is not a problem, but for an existing codebase and tracing what goes where is what I'm having difficulty with.
Certainly this is not a knock against Qt. All UI software is kind of like this. So for this case, where an existing codebase uses Qt and localization, how do I figure out, from looking at something like a QDialog, where the associated logic will be? I don't expect it to be in plain sight and I don't know what files/constructs/docs to look for.
I see the text specified in .ini files being used in the QDialog but I am having trouble tracing the string's name to a form file or code.
Thanks
-
Hi, its not 100% sure the dialog has a UI file.
It is easy to make without.
You can check the constructor of the Dialog (in cpp)
if It has
ui->setupUi(this);
there is a UI file.Also if u stand in the Dialogs h file, you can right click functions and variables and
use the "Find Usages" too see where its being used.
That is what I use to "discover" the structure of a new project.Also "follow symbol under cursor" is good for the other way, as in
where does this live.If you are after localization, you would go and look for QTranslator using the super find function.
Note, if they use a ini file, it might not be the normal way.