×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    4

    Beginners problem: display a dialog

    Hi,

    I'm new to Qt, so please be patient with a probably simple question. I'm trying to show a (modal) dialog when a button is pressed in my main window. This is based on QWidget and displayed with .showFullScreen().
    The Dialog was created with the dialog designer of Qt Creator. In the slot function which is called when the button is pressed, I instantiate an object from the class created by the designer. I expected to be able to display it by simply calling its .exec() method. But I found that I have to first hide my main window to be able to see the dialog. But there should be a way to have the dialog simply appear on top of the main window.

    Can anyone tell me what I'm missing here?

  2. #2
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: Beginners problem: display a dialog

    Maybe you need to show() the dialog?

  3. #3
    Registered User
    Join Date
    Oct 2010
    Posts
    4

    Re: Beginners problem: display a dialog

    Sorry, I forgot to mention this. Of course, I did call the .show() method of the dialog before doing the .exec().
    But it only appears when I hide the main window.

  4. #4
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Beginners problem: display a dialog

    Did you parent a dialog to the main window?

  5. #5
    Registered User
    Join Date
    Oct 2010
    Posts
    4

    Re: Beginners problem: display a dialog

    Damn, I knew it would be some really stupid mistake.
    Of course I omitted the parent parameter, so it defaulted to null.

    Thank you very much for this quick diagnosis of my problem.

Similar Threads

  1. Display Yes/No Dialog
    By fatah3000 in forum Symbian
    Replies: 1
    Last Post: 2010-06-30, 11:20
  2. Simple beginners problem
    By przemast in forum Symbian
    Replies: 6
    Last Post: 2009-08-07, 10:30
  3. Beginners Dll-problem
    By juhanay in forum Symbian
    Replies: 1
    Last Post: 2006-04-08, 05:22
  4. dialog display problem
    By royashok in forum Symbian User Interface
    Replies: 0
    Last Post: 2003-06-27, 16:03
  5. how can i display a dialog?
    By sridhar_ratna in forum Symbian User Interface
    Replies: 0
    Last Post: 2003-04-18, 07:25

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×