chiaminhsu
22nd January 2013, 16:05
Hi,
I have a project to lock the window size while doing something.
When the job is finished, the window can be expanded again.
I try to
setFixedSize() is called first, and then
setSizePolicy() is called to set the window resizable again.
setFixedSize() works, however, setSizePolicy() can not enable
resizing function again.
Is resizing after setFixedSize() possible ?
void MainWindow::startAct()
{
this->setFixedSize(this->size());
QTimer::singleShot(60000, this, SLOT(endAct()));
}
void MainWindow::endAct()
{
this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); // resizable again
}
I have a project to lock the window size while doing something.
When the job is finished, the window can be expanded again.
I try to
setFixedSize() is called first, and then
setSizePolicy() is called to set the window resizable again.
setFixedSize() works, however, setSizePolicy() can not enable
resizing function again.
Is resizing after setFixedSize() possible ?
void MainWindow::startAct()
{
this->setFixedSize(this->size());
QTimer::singleShot(60000, this, SLOT(endAct()));
}
void MainWindow::endAct()
{
this->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); // resizable again
}