Prevent QMdiArea's current subwindow switching
-
I have a QMdiArea with several subwindows, when the user wants to switch from one subwindow to another, I need to do some check, and may need to prevent the switching. I tried the below:
-
Capture "subWindowActivated" signal of QMdiArea, but the signal actually emited only after the switching
-
Capture the "aboutToActivate" signal of the subwindow, but in this signal I can't call "setActiveSubWindow" to force switching back to the previous window, or the application will crash.
So, any good method to achieve my goal?
-
-
Hi,
What kind of checks are they ?
What about doing it the other way around: keep the other subwindows disabled until the checks pass ? -
Then I stay by my suggestion: make your sub window "modal" so that your application users know that they have to first do things correctly before going further with their actions.