Results 1 to 2 of 2

Thread: How to inactivate qdialog

  1. #1
    Join Date
    Sep 2011
    Posts
    3
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default How to inactivate qdialog

    Hi,

    In my program I have 2 qdialogs. In first dialog when a certain push button is clicked I want to pop up the second dialog but at the same time I want to run the rest of the code in the first dialog.
    I did something like this in my first dialog box.

    //code1
    Dialog2 *d11=new Dialog2();
    d11->exec();
    //code2

    But when it is running the 2nd dialog appears and the code beyond the originating of 2nd dialog (code2) doesn't run. What should I do in order to pop up 2nd dialog and be inactive during the execution?

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

    Default Re: How to inactivate qdialog

    Call show() not exec() if you want a non-modal dialog.

    Oh, and make sure you arrange to free the memory you allocated for dialog2.

Similar Threads

  1. Replies: 9
    Last Post: 25th March 2011, 21:22
  2. QDialog.exec() exiting without calling QDialog::accept()
    By doggrant in forum Qt Programming
    Replies: 3
    Last Post: 2nd February 2011, 11:35
  3. closing a Qdialog called from a Qdialog
    By OverTheOCean in forum Qt Programming
    Replies: 3
    Last Post: 28th September 2009, 08:02
  4. How to "lock" a new qdialog in another qdialog
    By donglebob in forum Qt Programming
    Replies: 7
    Last Post: 4th February 2009, 08:37
  5. QDialog ?
    By allensr in forum Qt Programming
    Replies: 7
    Last Post: 28th November 2007, 19:35

Tags for this Thread

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.