PDA

View Full Version : Simple Dialog



hesitation
9th June 2009, 23:06
Hi,
I created a new dialog project with Qt Creator IDE, then I changed the Window Title from "MyDialog" in "Hello" using the GUI interface, but I didn't find the simple change in the code, I looked in main.cpp, in mydialog.h and in mydialog.cpp, I'd like to know wich part of code changes when I change something in the GUI.

Thanks

ChrisW67
10th June 2009, 00:19
If you changed the window title in Designer (embedded in Creator) then the results will appear in the mydialog.ui XML file and the (usually hidden) ui_mydialog.h file probably in the retranslateUi() method. Your mydialog.cpp instantiates the class defined in ui_mydialog.h to set up the UI.

hesitation
10th June 2009, 00:53
Thank You,
so the file with ui extension is a xml file read from the designer embedded in qt creator. I opened it and I could see the change, but I don't understand how the xml file works in the project. At least a source code needs to compile the application, anyway thanks and sorry for my english.

:)

ChrisW67
10th June 2009, 01:04
The XML file is created and maintained by Designer. At build time it is processed by the user interface compiler (uic) to produce code to create the UI. That code goes into ui_mydialog.h file and is included in the mydialog.cpp file. It provides the function setupUi() that you see.

Creator normally hides the ui_mydialog.h intermediate files because they should not be of direct interest, but there is an option to show them above the file list in the main screen.

hesitation
10th June 2009, 01:18
Yes, you are right.
There is an option to show the generated file.

Thank You very much :)

aamer4yu
10th June 2009, 05:23
By the way, did u recompile after changing the gui from designer ?

hesitation
10th June 2009, 10:50
Of course I did, and I could see the new window title.

Thanks :)