PDA

View Full Version : cannot resize window properly to 1/4 and resize back to original size



saman_artorious
29th December 2013, 16:23
I cannot resize window properly. when the minimize button is clicked,
this->setMaximumSize(400, 400); works, but it overwrites previous window and the other parts of the UI still remain on the screen. The ui does not become smaller. Similarly, when I click minimize again to maximize UI, it again does not become bigger to the original size
ui->widget_display->setGeometry(200, 0, 791, 800);. I used the update() method, but still does not render the mainwindow from the beginning.



void MainWindow::on_pushButton_clicked()
{
if(minimized == false)
{
this->setMaximumSize(400, 400);
ui->widget->hide();
ui->widget_display->setGeometry(10, 10, 400, 400);
minimized = true;

update();
}
else
{
this->setMaximumSize(1152, 864);
ui->widget->show();
ui->widget_display->setGeometry(200, 0, 791, 800);
minimized = false;

update();
}

qDebug() << "Minimizing";
}

wysota
29th December 2013, 19:06
What is the purpose of using setMaximumSize() here?