Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Hot to get the size of a QMainWindow before it was maximized

Hot to get the size of a QMainWindow before it was maximized

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 387 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • l3u_L Offline
    l3u_L Offline
    l3u_
    wrote on last edited by
    #1

    Hi all!

    How can I get size of a QMainWindow before it was maximized?

    I tried to reimplement the changeEvent and look for WindowStateChange events, but if I catch one, the size() is already the maximized one.

    I tried to do a showNormal(), then read the size, but still, the size is the maximized one.

    setWindowFlags() is only passed to the d pointer's setWindowFlags(), so I think I have no chance to access the probably cached size that is restored if a Window is shown normal after having been maximized.

    I'm out of ideas … thanks for all help :-)

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      what about
      https://doc.qt.io/qt-5/qwidget.html#resizeEvent
      and the QResizeEvent::oldSize() ?

      1 Reply Last reply
      4
      • l3u_L Offline
        l3u_L Offline
        l3u_
        wrote on last edited by
        #3

        That's it! Thanks a lot :-)

        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved