Results 1 to 9 of 9

Thread: Open Dialog from MainWindow.

  1. #1
    Join Date
    Mar 2010
    Posts
    34
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Open Dialog from MainWindow.

    Hi!

    I want to open AboutDialog.ui when i click QAction "About".

    Qt Code:
    1. void MainWindow::on_actionAbout_triggered()
    2. {
    3. //Code for viewing AboutDialog.ui file here.
    4. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Oct 2009
    Posts
    105
    Thanked 4 Times in 2 Posts
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Open Dialog from MainWindow.

    Create a pointer of the class which is derived from AboutDialog.Ui.
    call pointer->show();
    It will display the dialog.

  3. #3
    Join Date
    Mar 2010
    Posts
    34
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Open Dialog from MainWindow.

    I am a beginner so how can i do that?

    Create in Qt Designer or?

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Open Dialog from MainWindow.

    Quote Originally Posted by halvors View Post
    I am a beginner
    Then you should use the Newbie section! Therefore it exists.

    Read this http://doc.trolltech.com/4.6/designe...a-ui-file.html and QDialog.

  5. #5
    Join Date
    Oct 2009
    Posts
    105
    Thanked 4 Times in 2 Posts
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Open Dialog from MainWindow.

    Quote Originally Posted by halvors View Post
    I am a beginner so how can i do that?

    Create in Qt Designer or?
    Yes. u should create the aboutdialog ui in creator. Create an user define class which is derived from this dialog. and create this class pointer inside mainwindow calss. call the show methode.

  6. #6
    Join Date
    Mar 2010
    Posts
    34
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Open Dialog from MainWindow.

    Can you show some exemples??

    Plz =)=)

  7. #7
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Open Dialog from MainWindow.

    There are lots of examples bundled with Qt in the 'Examples' directory which show you how to do it.

  8. #8
    Join Date
    Oct 2009
    Posts
    105
    Thanked 4 Times in 2 Posts
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Open Dialog from MainWindow.

    Quote Originally Posted by halvors View Post
    Can you show some exemples??

    Plz =)=)
    Chk attached code.
    Attached Files Attached Files

  9. The following 3 users say thank you to sudhansu for this useful post:

    biggerbabou (18th May 2010), tens0r (15th April 2010), Zark (14th September 2010)

  10. #9
    Join Date
    Mar 2010
    Posts
    34
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Open Dialog from MainWindow.

    Thanks, i gor it work.

    Do you know how i can make a void or someting who connect to a server via RCON.

  11. The following user says thank you to halvors for this useful post:

    Gibnem (8th March 2013)

Similar Threads

  1. Open mainwindow
    By cwnelatury in forum Newbie
    Replies: 1
    Last Post: 17th April 2009, 22:46
  2. Passing Pixmaps between MainWindow and Dialog
    By ramstormrage in forum Qt Programming
    Replies: 28
    Last Post: 20th April 2008, 13:32
  3. Communication between MainWindow and a dialog
    By Backslash in forum Newbie
    Replies: 9
    Last Post: 3rd August 2007, 04:27
  4. Replies: 2
    Last Post: 23rd May 2007, 03:51
  5. Opening a Dialog from a MainWindow FileMenu
    By nbkhwjm in forum Newbie
    Replies: 4
    Last Post: 17th April 2007, 12:24

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.