PDA

View Full Version : Event - closing/activate window



chaimar
23rd May 2006, 14:24
Hi,
I have a mainwindow which need to know if any of the other objects that have an own window, for example a reportwindow is activated or closed. If the reportwindow is activated, the mainwindow change state and look(widgetstack). Same thing if the report is beeing closed, the mainwindow should go to previous state and look.

All that is ok, but if the report is open, but not activated and I'm doing something in the mainwindow and think that the report doesn't have to be open. Then I can close the report directly by pushing the 'X'-button in the upper-right corner of the reportwindow, if its visible, if it's not visible - this is not a problem:)
The problem is that the event windowActivated will be sent first, followed by a closeEvent. Then I get some bad flickering on the screen, as the mainwindow first change state to fit the report, then closing it and retrieving the previous state.

Is there a nice solution on this little, but annoying problem?

Thanks,
Chaimar

wysota
16th June 2006, 10:12
Maybe you could use a timer and only change the state if it persists over a second or so?