Results 1 to 2 of 2

Thread: QDialog

  1. #1
    Join Date
    Jul 2010
    Posts
    72
    Thanks
    35
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QDialog

    Hello,

    I created two QDialogs, say dialog_A and dialog_B. Dialog_A has a button which, when clicked, should show dialog_B. For this purpose I defined a slot buttonAclicked(), declared in dialog_A as follows:

    void Dialog_A::buttonAclicked(){
    dialog_B dialo;
    dialo.show();
    }

    After I defined this slot, I connected the button of dialog_A with it.
    The code compiles fine, but when when dialog_A is created and I click the respective button, nothing happens (dialog_B is not shown).

    Any suggestion why this is not working?
    Cheers

  2. #2
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    383
    Thanks
    52
    Thanked 42 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QDialog

    Use:
    Qt Code:
    1. QDialog dlg;
    2. dlg.exec();
    To copy to clipboard, switch view to plain text mode 

    or

    Qt Code:
    1. QDialog *dlg = new QDialog();
    2. dlg->show();
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to Talei for this useful post:

    Maluko_Da_Tola (9th August 2010)

Similar Threads

  1. closing a Qdialog called from a Qdialog
    By OverTheOCean in forum Qt Programming
    Replies: 3
    Last Post: 28th September 2009, 08:02
  2. QDialog in DLL
    By markvi in forum Qt Programming
    Replies: 0
    Last Post: 16th September 2009, 10:31
  3. How to "lock" a new qdialog in another qdialog
    By donglebob in forum Qt Programming
    Replies: 7
    Last Post: 4th February 2009, 08:37
  4. QDialog
    By seldeepchan in forum Qt Programming
    Replies: 1
    Last Post: 6th March 2008, 12:21
  5. QDialog ?
    By allensr in forum Qt Programming
    Replies: 7
    Last Post: 28th November 2007, 19:35

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.