Results 1 to 9 of 9

Thread: Qt dialog

  1. #1
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Qt dialog

    Hi,
    I'm trying to learn how to create and launch a dialog from my main application but I don't find valid tutorial or resources.
    Can I have a help please?

    Best Regards,
    Franco
    Franco Amato

  2. #2
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt dialog

    It depends on what dialog do you want to have. If some simple warning or question then use QMessageBox's static methods (like QMessageBox::warning()). If it is not enough then either create your own dialog by subclassing QDialog and connecting some buttons or whatever you will have there to accept() and reject() slots of your dialog and then just create object of your class and call QDialog::exec() on it or you can create object of QDialog, set widgets and layouts to it (connect what you want to accept() and reject()) and call exec() on it.
    Last edited by faldzip; 6th February 2010 at 22:01.
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  3. #3
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt dialog

    Quote Originally Posted by faldżip View Post
    It depends on what dialog do you want to have. If some simple warning or question then use QMessageBox's static methods (like QMessageBox::warning()). If it is not enough then either create your own dialog by subclassing QDialog and connecting some buttons or whatever you will have there to accept() and reject() slots of your dialog and then just create object of your class and call QDialog::exec() on it or you can create object of QDialog, set widgets and layouts to it (connect what you want to accept() and reject()) and call exec() on it.
    Hi sorry but I don't understand. I would create a audio track list that used can drag and drop on the main application. I would use qtdesigner but it generates a .ui files. I never did this. Can you help me? Maybe with some examples?
    Franco Amato

  4. #4
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt dialog

    Quote Originally Posted by franco.amato View Post
    Hi sorry but I don't understand. I would create a audio track list that used can drag and drop on the main application. I would use qtdesigner but it generates a .ui files. I never did this. Can you help me? Maybe with some examples?
    Ok, so where in this case you want to use dialog?
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  5. #5
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt dialog

    Quote Originally Posted by faldżip View Post
    Ok, so where in this case you want to use dialog?
    Hi, I would use the dialog when a user wants add files to the track list or when a user wants do some operation on a file of the track list.
    For example a user press File->"Open From Track list"
    Franco Amato

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

    Default Re: Qt dialog

    Maybe you can draw a rough sketch of what you need and post it?

  7. #7
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt dialog

    Quote Originally Posted by fatjuicymole View Post
    Maybe you can draw a rough sketch of what you need and post it?
    Ok I try it.

    When I press File->add to list as you can see in the image 1 image1.jpg I would launch a dialog similar to this in the image 2image2.jpg but I'm unable to create the dialog. I would use designer to do faster but I saw that designer only create a *.ui file.

    What I have to do with this ui file?

    Best Reards,
    Franco
    Franco Amato

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

    Default Re: Qt dialog

    You can use 'uic' to convert 'ui' file to '.h' file. This file contains a class with a function 'setupUi' that will create the ui you designed in QtDesigner.

  9. #9
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Thanks
    59
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt dialog

    Quote Originally Posted by fatjuicymole View Post
    You can use 'uic' to convert 'ui' file to '.h' file. This file contains a class with a function 'setupUi' that will create the ui you designed in QtDesigner.
    Ah is there any tutorial on how to do it? Must I create a custom rule? I work with visual studio
    Franco Amato

Similar Threads

  1. How to blur parent dialog when child dialog is displayed
    By abhilashajha in forum Qt Programming
    Replies: 4
    Last Post: 10th June 2009, 13:01
  2. Dialog to Dialog communication
    By jjbabu in forum Qt Tools
    Replies: 1
    Last Post: 1st October 2008, 10:54
  3. call the other dialog through dialog
    By narumi in forum Qt Programming
    Replies: 2
    Last Post: 3rd September 2008, 09:30
  4. About Dialog
    By anafor2004 in forum Qt Programming
    Replies: 2
    Last Post: 6th May 2008, 16:37
  5. Dialog
    By gyre in forum Newbie
    Replies: 3
    Last Post: 21st November 2007, 21:39

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.