Results 1 to 5 of 5

Thread: Problem QWizardPage not modal

  1. #1
    Join Date
    Jul 2008
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Problem QWizardPage not modal

    hi all,
    I've qt 4.4.0
    On my QWizard I want to set a NOT MODAL QWizardPages, to take some values from qmainwindows behind the qwizardpage.
    I cannot make this.
    If I call cc.show() nothing is visualized, I must use cc.exec() but it creates a modal Dialog

    I attach a piece of code


    Qt Code:
    1. void MissionTree_Control::wizard_Show()
    2. {
    3. ClassWizard cc(m_parent);
    4. // cc.exec();
    5. cc.show();
    6. std::cout<<";-)"<<std::endl;
    7. }
    8.  
    9. ClassWizard::ClassWizard(QWidget *parent) : QWizard(parent)
    10. {
    11. addPage(new Intro_Page);
    12. addPage(new GCS_Page);
    13. setWindowTitle(tr("Mission definition"));
    14. setWizardStyle(QWizard::ModernStyle);
    15. }
    16.  
    17.  
    18. Intro_Page::Intro_Page(QWidget *parent): QWizardPage(parent)
    19. {
    20. setWindowModality(Qt::WindowModal);
    21. setTitle(tr("..."));
    22. setPixmap(QWizard::WatermarkPixmap, QPixmap("..."));
    23. ...
    24. }
    25.  
    26. GCS_Page::GCS_Page(QWidget *parent): QWizardPage(parent)
    27. {
    28. setWindowModality(Qt::NonModal);
    29. setTitle(tr("..."));
    30.  
    31. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by jpn; 19th December 2008 at 14:13. Reason: missing [code] tags

  2. #2
    Join Date
    Mar 2008
    Posts
    141
    Thanks
    10
    Thanked 9 Times in 9 Posts

    Default Re: Problem QWizardPage not modal

    hi,

    QWizardPage does not inherit QDialog. I guess you should set the modality within QWizard.

  3. #3
    Join Date
    Jul 2008
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Problem QWizardPage not modal

    ok thanks.
    I try this using the .show() method for visualize a not modal QWizard set of pages but nothig is showed..
    I must use .exec() method but show a modal set of pages..

    why the .show() method not func?

    thank a lot

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Problem QWizardPage not modal

    Quote Originally Posted by Rooster1 View Post
    I must use .exec() method but show a modal set of pages..
    It "works" in your case because QDialog::exec() blocks until the modal dialog is closed.

    why the .show() method not func?
    It works, but because show() doesn't block but returns immediately, the wizard goes out of scope and gets destructed according to normal C++ rules. You must use the C++ operator new to allocate the dialog on the heap.
    J-P Nurmi

  5. #5
    Join Date
    Jul 2008
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Problem QWizardPage not modal

    Now it's ok!
    Thank you very much!!!

Similar Threads

  1. Weird problem: multithread QT app kills my linux
    By Ishark in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2008, 09:12
  2. Steps in solving a programming problem?
    By triperzonak in forum General Programming
    Replies: 8
    Last Post: 5th August 2008, 08:47
  3. modal dialog blocking problem...
    By photonmaster in forum Qt Programming
    Replies: 3
    Last Post: 4th June 2008, 09:49
  4. Bug with modal windows on Mac? [Qt 3.3]
    By kalos80 in forum Qt Programming
    Replies: 0
    Last Post: 15th February 2008, 16:52
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.