Results 1 to 7 of 7

Thread: Simple Dialog

  1. #1

    Default Simple Dialog

    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
    Last edited by hesitation; 10th June 2009 at 01:45.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: Simple Dialog

    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.

  3. #3

    Default Re: Simple Dialog

    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.


  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: Simple Dialog

    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.

  5. #5

    Default Re: Simple Dialog

    Yes, you are right.
    There is an option to show the generated file.

    Thank You very much

  6. #6
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 334 Times in 317 Posts

    Default Re: Simple Dialog

    By the way, did u recompile after changing the gui from designer ?

  7. #7

    Default Re: Simple Dialog

    Of course I did, and I could see the new window title.

    Thanks

Similar Threads

  1. Issue with Modelless dialog on Mac
    By Satyanarayana Chebrolu in forum Qt Programming
    Replies: 0
    Last Post: 24th February 2009, 11:10
  2. Dialog is not closing
    By manmohan in forum Newbie
    Replies: 5
    Last Post: 1st December 2008, 18:04
  3. Replies: 9
    Last Post: 13th August 2008, 19:07
  4. QGraphicsView: Dialog Position Doubt
    By arjunasd in forum Qt Programming
    Replies: 1
    Last Post: 6th August 2007, 18:48
  5. can't get a simple dialog working
    By pthomas in forum Newbie
    Replies: 8
    Last Post: 13th January 2006, 15:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.