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. Getting maximized dialogs normal size?

Getting maximized dialogs normal size?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 259 Views 1 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.
  • D Offline
    D Offline
    Dan203
    wrote on last edited by
    #1

    I want to save the size of a dialog so I can restore it on subsequent runs. But when the dialog is maximized I want to save it's unmaximized size and then a flag stating that it's maximized so that if the user clicks the restore button it returns to its smaller state.

    I tried calling showNormal() in the accept/reject handlers before saving the size, but when I do that width()/height() still return the maximized size values. I even tried adding a sleep, thinking maybe they needed a second to catch up, but still no. If I restore the dialog manually and then close I get the proper values. But restoring it to normal from code using showNormal or setWindowState both still result in the maximized size being reported.

    Is there any way to get the "normal" size from a dialog when it's maximized? Or some way for me to call showNormal() and then wait in a non-blocking way until the dialog is resized and the values are correct?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      Dan203
      wrote on last edited by
      #2

      Of course I figured this out just a few minutes after posting, sorry for wasting your time.

      Anyone who's interested there is a function in the dialog/widget class called normalGeometry() which holds the unmaximized size of the window.

      1 Reply Last reply
      3

      • Login

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