How to change size of QWidget by connect(button...)
-
Please help with two problems.
1)I need to connect one of buttons of this class with changing size of myWindow by consts. (for exaplme setSize(x*y) ).@class MyWindow : public QWidget, public Ui::MyWindow
{
Q_OBJECT
//...
}
@
2) And how I can prevent to user to change the size?
@layout()->setSizeConstraint(QLayout::SetFixedSize);@
is't work. It crashes the program:
@
Runs MyWindow.exe ....
The program terminated unexpectedly.
MyWindow.exe exited with code -1073741819
@ -
"QWidget::setFixedSize":http://qt-project.org/doc/qt-4.8/qwidget.html#setFixedSize-2
-
Ok, but I need to connect it. That's method, not slot. Sorry for quations like this I have not perfect English.
-
@void MyWindow::sizeBigger()
{
this->setFixedSize(477, 250);
groupBox_3->show();
}
void MyWindow::sizeSmoller()
{
this->setFixedSize(477, 180);
groupBox_3 -> hide();
}
@
Is work, thank you! But, after sizeSmoller all groupBoxes become Black.
groupBox_3 - lowest groupBox.
!http://i.imgur.com/iRz9Egdl.jpg(Problem)!