Results 1 to 2 of 2

Thread: cannot resize window properly to 1/4 and resize back to original size

  1. #1
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default cannot resize window properly to 1/4 and resize back to original size

    I cannot resize window properly. when the minimize button is clicked,
    Qt Code:
    1. this->setMaximumSize(400, 400);
    To copy to clipboard, switch view to plain text mode 
    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
    Qt Code:
    1. ui->widget_display->setGeometry(200, 0, 791, 800);
    To copy to clipboard, switch view to plain text mode 
    . I used the update() method, but still does not render the mainwindow from the beginning.

    Qt Code:
    1. void MainWindow::on_pushButton_clicked()
    2. {
    3. if(minimized == false)
    4. {
    5. this->setMaximumSize(400, 400);
    6. ui->widget->hide();
    7. ui->widget_display->setGeometry(10, 10, 400, 400);
    8. minimized = true;
    9.  
    10. update();
    11. }
    12. else
    13. {
    14. this->setMaximumSize(1152, 864);
    15. ui->widget->show();
    16. ui->widget_display->setGeometry(200, 0, 791, 800);
    17. minimized = false;
    18.  
    19. update();
    20. }
    21.  
    22. qDebug() << "Minimizing";
    23. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: cannot resize window properly to 1/4 and resize back to original size

    What is the purpose of using setMaximumSize() here?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Main Window Size not Scaled Properly
    By alok9871 in forum Newbie
    Replies: 7
    Last Post: 13th January 2013, 21:18
  2. window and list box resize
    By maarvi in forum Newbie
    Replies: 4
    Last Post: 5th May 2011, 09:41
  3. Replies: 6
    Last Post: 26th January 2011, 21:00
  4. A bug in window resize
    By elcuco in forum Qt Programming
    Replies: 2
    Last Post: 6th December 2009, 01:04
  5. Replies: 1
    Last Post: 13th September 2008, 14:45

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.