litroncn
28th May 2008, 11:18
I create a page named TestPage, this is its constructor:
TestPage::TestPage(QWidget *parent)
:QWizardPage(parent)
{
QPushButton *button = new QPushButton("Start");
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(button);
setLayout(layout);
}
When I run it, the button appears on the page. However, if I do the following…
TestPage::TestPage(QWidget *parent)
:QWizardPage(parent)
{
QPushButton *button = new QPushButton(this);
}
…the button is invisible. So, to show the page contents do I need to use layout management? Or is there another way to implement displaying a button or other widgets without using layout management ?
Thanks in advance
TestPage::TestPage(QWidget *parent)
:QWizardPage(parent)
{
QPushButton *button = new QPushButton("Start");
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(button);
setLayout(layout);
}
When I run it, the button appears on the page. However, if I do the following…
TestPage::TestPage(QWidget *parent)
:QWizardPage(parent)
{
QPushButton *button = new QPushButton(this);
}
…the button is invisible. So, to show the page contents do I need to use layout management? Or is there another way to implement displaying a button or other widgets without using layout management ?
Thanks in advance