Results 1 to 2 of 2

Thread: QDialog inside QWizardPage

  1. #1
    Join Date
    Aug 2007
    Posts
    275
    Thanks
    28
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default QDialog inside QWizardPage

    Guys,

    I have QDialog that I want to put inside a QWizardPage, is this possible? I have tried testing it QDialog won't stay inside the wizard page . Is there any way I can manage to put this dialog inside the page?

    Qt Code:
    1. #include "wizard.h"
    2.  
    3.  
    4. Wizard::Wizard(QWidget* parent)
    5. :QWizard(parent)
    6. {
    7. //ctor
    8. addPage(new firstPage(this));
    9. }
    10.  
    11. Wizard::~Wizard()
    12. {
    13. //dtor
    14. }
    15. void Wizard::accept(void)
    16. {}
    17.  
    18. firstPage::firstPage(QWidget* parent)
    19. :QWizardPage(parent)
    20. {
    21. //ctor
    22. setTitle(tr("Class Information"));
    23. setSubTitle(tr("Specify basic information about the class for which you "
    24. "want to generate skeleton source code files."));
    25. QHBoxLayout* lo = new QHBoxLayout();
    26. QDialog* dialog = new QDialog(this);
    27.  
    28. lo->addWidget(dialog);// i thought this will bring the dialog in the page
    29. dialog->show(); // i tried bypassing this but I can't see the dialog
    30.  
    31. QHBoxLayout* dlo = new QHBoxLayout(dialog);
    32. QPushButton* btn = new QPushButton("Aha",dialog);
    33. dlo->addWidget(btn);
    34.  
    35. setLayout(lo);
    36. }
    To copy to clipboard, switch view to plain text mode 

    this is my test code

    baray98

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QDialog inside QWizardPage

    Why would you want to add a dialog inside a QWizard? Dialogs are top level widgets by default, so embedding them into other widgets is not trivial. Nevertheless since 4.0 I don't see why anyone would want to do it...

Similar Threads

  1. Resizing a QDialog to the content size
    By Nyphel in forum Qt Programming
    Replies: 8
    Last Post: 15th March 2007, 08:16

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.