PDA

View Full Version : Any signal emitting while window is restored/maximized other than using changeEvent()



vkn
8th August 2012, 10:37
In my Qt application, there is a QDockwidget (on left) and a central widget. My need is: User clicks on window's maximize button and stretches QDockwidget's width (by mouse) and then clicks on restore button. And then user clicks on window's maximize button again, at this the earlier QDockwidget's width setting (when window was maximised) should remain. Currently in my application it doesn't.

So for this I am making use of saveState() and restoreState(). Have now added changeEvent(), inside it, if window state changed and window is restored then calling saveState() and when window is maximised then calling restoreState(). But the problem seem to me that saveState() saves the current state that is after window is restored and not before. I want to save the state that user did (stretched QDockwidget) while window was maximised (just before restore button is clicked).

Or is there any way/signals emitting while window is minimized/restored/maximized other than using changeEvent().

Any help or suggestion is appreciated. Thanks.

vkn
10th August 2012, 07:54
Found out. My mistake..

When restore down button clicked then saveState() was saving the state that was while window was maximised (just before restore button is clicked). The problem was with my resizeEvent().

jimmy45
10th August 2012, 08:15
hy nice post