Results 1 to 11 of 11

Thread: Restore the size of the window after minimize

  1. #1
    Join Date
    Jan 2006
    Location
    Catalonia
    Posts
    266
    Thanks
    44
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Question Restore the size of the window after minimize

    Hi, I want to know how to restore the size (and position) of a window after been minimized. I have tried it with showNormal but it reduzes the size of the window if the window was at full screen before minimize it. Anybody knows it?

    Thanks.

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

    Default Re: Restore the size of the window after minimize

    Doesn't show() do what you want?

  3. #3
    Join Date
    Jan 2006
    Location
    Catalonia
    Posts
    266
    Thanks
    44
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Restore the size of the window after minimize

    Quote Originally Posted by wysota
    Doesn't show() do what you want?
    Sorry wysota, I thought that show() only was useful when the window is explicitly hidden, not minimized...

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,709
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Restore the size of the window after minimize

    if you want to restore a window you should use showNormal().

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

    Default Re: Restore the size of the window after minimize

    What about raise() or activateWindow()?

  6. #6
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,709
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Restore the size of the window after minimize

    Ahh sorry, I see now you tried with showNormal()...
    I use showNormal on a dialog which I took off its title bar and handled all that my self.
    For me showNormal behaves just like it would with a normal window, meaning, if I maximize the dialog, then minimize it and then resotre it, it will come back to be maximized.
    Check if you are not calling showNormal twise after minimized state, this could have the effect your are experiancing, meaning, once it restores(to maximized), and the scond call restores it back to the not maximize size...

  7. #7
    Join Date
    Jan 2006
    Location
    Catalonia
    Posts
    266
    Thanks
    44
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Restore the size of the window after minimize

    Quote Originally Posted by wysota
    What about raise() or activateWindow()?
    I will try it thanks.

  8. #8
    Join Date
    Jan 2006
    Location
    Catalonia
    Posts
    266
    Thanks
    44
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Restore the size of the window after minimize

    Quote Originally Posted by high_flyer
    For me showNormal behaves just like it would with a normal window, meaning, if I maximize the dialog, then minimize it and then resotre it, it will come back to be maximized.
    When you talk about "restore" it what you mean, calling "showNormal"? I thought that showNormal has this behaviour but doesn't seems so in my app...

    Quote Originally Posted by high_flyer
    check if you are not calling showNormal twise after minimized state, this could have the effect your are experiancing, meaning, once it restores(to maximized), and the scond call restores it back to the not maximize size...
    I will check it thanks
    Last edited by SkripT; 25th March 2006 at 11:05.

  9. #9
    Join Date
    Nov 2007
    Posts
    17
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Restore the size of the window after minimize

    Hi all
    Please apologize for re-activating this thread, but I'm unable to find a proper solution. Is it possible to show a widget maximized/minimized depending on his previous state? I thought, showNormal() will do the job but in my sample the widget pops up with a bit of flickering... and then it will be showed in normal state.

    ..thanks!

  10. #10
    Join Date
    Feb 2016
    Posts
    6
    Thanks
    7
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Restore the size of the window after minimize

    I am facing the same problem, to clarify further it is as follows
    - my window in maximized to full screen by me
    - I minimized it
    - now from code, if I call showNormal() it restores it but it does not stay full screen anymore which is the desired behavior.

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

    Default Re: Restore the size of the window after minimize

    showNormal() shows the window as a normal (i.e. not full screen) window. Try calling show() or showFullScreen().
    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. update window size
    By eric in forum Newbie
    Replies: 3
    Last Post: 14th January 2008, 10:21
  2. Minimize other Window
    By johncharlesb in forum Qt Programming
    Replies: 1
    Last Post: 14th October 2007, 16:22
  3. Problem hiding main window on minimize
    By bpetty in forum Newbie
    Replies: 5
    Last Post: 18th September 2007, 17:41
  4. window sizes changing even though max size defined
    By JonathanForQT4 in forum Newbie
    Replies: 3
    Last Post: 6th August 2007, 10:39
  5. Replies: 1
    Last Post: 9th February 2007, 09:41

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.