Solved Hot to get the size of a QMainWindow before it was maximized
-
Hi all!
How can I get size of a
QMainWindow
before it was maximized?I tried to reimplement the
changeEvent
and look forWindowStateChange
events, but if I catch one, thesize()
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'ssetWindowFlags()
, 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 :-)
-
Hi
what about
https://doc.qt.io/qt-5/qwidget.html#resizeEvent
and the QResizeEvent::oldSize() ? -
That's it! Thanks a lot :-)