PDA

View Full Version : QDialog inside QWizardPage



baray98
9th May 2008, 06:40
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?



#include "wizard.h"


Wizard::Wizard(QWidget* parent)
:QWizard(parent)
{
//ctor
addPage(new firstPage(this));
}

Wizard::~Wizard()
{
//dtor
}
void Wizard::accept(void)
{}

firstPage::firstPage(QWidget* parent)
:QWizardPage(parent)
{
//ctor
setTitle(tr("Class Information"));
setSubTitle(tr("Specify basic information about the class for which you "
"want to generate skeleton source code files."));
QHBoxLayout* lo = new QHBoxLayout();
QDialog* dialog = new QDialog(this);

lo->addWidget(dialog);// i thought this will bring the dialog in the page
dialog->show(); // i tried bypassing this but I can't see the dialog

QHBoxLayout* dlo = new QHBoxLayout(dialog);
QPushButton* btn = new QPushButton("Aha",dialog);
dlo->addWidget(btn);

setLayout(lo);
}


this is my test code

baray98

wysota
9th May 2008, 08:28
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...