The problem is with you hideEverything() method. It explicitly hides more than you want and afterwards too less widgets are shown again.
Try
@
void TestPage::hideEverything()
{
foreach(QWidget w, m_fDetailsFrame->findChildren<QWidget>()) {
qDebug() << "Hiding" << w;
w->hide();
}
}
@
This are all the widgets hidden:
@
QComboBox(0xf5b700, name = "comboBox")
QComboBoxPrivateContainer(0x127df8e0)
QComboBoxListView(0x127dcba0)
QWidget(0x127dd6d0, name = "qt_scrollarea_viewport")
QWidget(0x127dc250, name = "qt_scrollarea_hcontainer")
QScrollBar(0x127b9f00)
QWidget(0x127dec90, name = "qt_scrollarea_vcontainer")
QScrollBar(0x127def70)
QComboBoxPrivateScroller(0x127e0190)
QComboBoxPrivateScroller(0x127e0320)
QLabel(0xf45330, name = "label")
@
You re-show only two of them. The private sub widgets of the combo boxes are not shown again and thus remain hidden or in a weird state.
Additionally:
Your program crashes in the the destructors:
@
TestPage::~TestPage()
{
// ERROR: double delete
delete m_fDetailsFrame;
delete m_gLayout;
}
// and
TestWizard::~TestWizard()
{
// ERROR: double delete
delete m_tp;
}
@
You delete the members although they are automatically deleted via Qt's parent-child relationship of QObjects.
Additonally 2:
You have weird system to access the members of your UI. Finding them via findChild() is expensive and error prone. You can access them directly via the ui member object:
@
m_fDetailsFrame->findChild<QWidget*>("comboBox")->show();
// is the same as
ui.comboBox->show();
@
As an additional goodie you get the pointer to the right class (QComboBox) and call QComboBox' methods. With your method you only get the QWidget pointer and only access to QWidget's methods.
Additionally 3:
You create Widgets but do not put them into layouts. Your UI will look ugly at best and be (partly) inaccessible by the user at worst.