Dear,
I read the others post, I'm doing as is written in the book by Blanchette & Summerfield but it doesn't work!!!!!!!!!
I explain better the situation:
- I have a QDialog containing three GroupBox and three button. One GroupBox and two button are hidden (let's call them: "button1","button2" and "groupBox")
- when the third button is clicked the hidden widgets are displayed.
I attached here the GUI I have prepared with Qt Designer.
The problems are:
- if I do as written in the book:
connect(button, SIGNAL(toggled(bool)), groupBox, SLOT(setVisible(bool)));
connect(button, SIGNAL(toggled(bool)), button1 SLOT(setVisible(bool)));
connect(button, SIGNAL(toggled(bool)), button2, SLOT(setVisible(bool)));
nothing is displayed when I click the button that should display the hidden widgets. I solved this problem implementing my own slot that works as this:
groupBox->setVisible(!OverviewGroupBox->isVisible());
button1->setVisible(!OverviewGroupBox->isVisible());
button2->setVisible(!OverviewGroupBox->isVisible());
- the second problem is that when the Dialog is displayed for the first time (with the three widgets hidden) the size is not set at the minimum, I mean... there is lot of left space, here attached there is also a screeshot...
To conclude here the code of the constructor of the dialog.
{
setupUi(this);
button1->hide();
button2->hide();
groupBox->hide();
layout()->setSizeConstraint(QLayout::SetFixedSize);
connect(button, SIGNAL(clicked()), this, SLOT(myslot()));
}
I hope this is enough to understand the problem.
Thanks in advance
Annalisa
Bookmarks