I create a page named TestPage, this is its constructor:
TestPage
::TestPage(QWidget *parent
) :QWizardPage(parent)
{
layout->addWidget(button);
setLayout(layout);
}
TestPage::TestPage(QWidget *parent)
:QWizardPage(parent)
{
QPushButton *button = new QPushButton("Start");
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(button);
setLayout(layout);
}
To copy to clipboard, switch view to plain text mode
When I run it, the button appears on the page. However, if I do the following…
TestPage
::TestPage(QWidget *parent
) :QWizardPage(parent)
{
}
TestPage::TestPage(QWidget *parent)
:QWizardPage(parent)
{
QPushButton *button = new QPushButton(this);
}
To copy to clipboard, switch view to plain text mode
…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
Bookmarks