Greetings,
Im having an extremely hard time getting my widget (a QDockWindow subclass) to trap a close event properly. I have sub-classed QDockWindow and reimplimented closeEvent for that sub-class.
The dockwindow is part of a QWorkspace that sits as the central widget of an application. I have a QMessageBox in the closeEvent that
tells me its being called. The only way I can make it be called is
if in my mainwindow class I do a direct call to close.
But what i really want is to do a the simple action detecting when the
window is closed with closeEvent. No matter what I do if I close the
window with the X in the right hand side I cant seem to trap the event.
I have put closeEvents in all the widgets involved and it never is called.
Does anyone have any idea what's going on? I have checked extensively this forum and qt interest, read about QCloseEvent, tried with and
without destructiveClose on the widget and everything else I could think
of including installing an even monitor from the main window - it never gets called ...
Im basically trying to have a button (like IExplorer's favorite) - if you hit
it once a dockable window comes up with a list of filenames. If you
hit the button again the dockable closes. Alternatively the user can hit
X and close the window manually. In either of the last 2 cases (close
by toggling button or close with X) the next time the (toggle) button
is pressed the list should appear again. At this point it is doing weird
stuff on me like pickingg from the listing when i hit the toggle button.
I am talking about a totally basic use of DockWindow and close event,
but its not working.
thanks for any help,
kelly