Results 1 to 4 of 4

Thread: QDialog problem when setting mainwindow as parent

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2011
    Posts
    42
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QDialog problem when setting mainwindow as parent

    well, at the constructor of the mainwindow we are showing that QDialog, so if the user acepts then the constructor finishes and displays the window, otherwhise it will quit the aplication.
    So i guess the mainwindow is not visible nor active at the time we create the dialog.

    But I still dot get it, once the user accepted the dialog, the mainwindow is visible and the dialog hidden. How could the creation of the QDialog affect the mainwindow? do you have any idea why is affecting the expanding effect?

    thanks a lot!

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QDialog problem when setting mainwindow as parent

    well, at the constructor of the mainwindow we are showing that QDialog,
    At this point the mainwindow is not yet visible, nor is it fully constructed, so geometry information is not valid, which explains any trouble related to geometry such as you do:
    animating and expanding.
    How could the creation of the QDialog affect the mainwindow? do you have any idea why is affecting the expanding effect?
    Well, if the dialog is modal, it stops the even loop for the mainwindow.
    Other than that, you are giving the dialog a non visible, not fully created parent, so I would expect even the dialog not to show, unless its modal, and I am not sure what the modal dialog does with such "half backed" parent.
    But having a visible widget with an invisible parent, is just asking for trouble.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

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

    superpacko (21st July 2011)

Similar Threads

  1. Replies: 2
    Last Post: 24th January 2010, 12:46
  2. SETTING THE TEXT COLOR FOR QMessageBox
    By vinkakarun in forum Newbie
    Replies: 2
    Last Post: 5th November 2009, 16:32
  3. setting background color of QMessageBox
    By wagmare in forum Qt Programming
    Replies: 7
    Last Post: 23rd May 2009, 13:26
  4. MainWindow disappearing when loading a QMessageBox
    By fabietto in forum Qt Programming
    Replies: 14
    Last Post: 25th June 2008, 23:41
  5. Setting QMessageBox geometry
    By Krish_ng in forum Qt Programming
    Replies: 3
    Last Post: 25th July 2007, 14:47

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.