Nominate our 2022 Qt Champions!

QMdiArea- Close all Subwindows

  • Hi,
    I have QMainWindow which has QMdiArea and I am trying to pop up a message box with QTreeView which displays Unsaved sub-windows list with a confirmation message whether user wants to Save-No-Cancel them as buttons on it.

    As I click on QMianWindow close button(X) it  brings up Confirmation Message Dialog Box and gets the user response.After that current QMdiSubwindow is loosing focus as active sub-window and QMdiArea.subWindowList(order=ActivationHistoryOrder)  is always gving me sub-windowslist in CreationOrder even after setting the QMdiArea.setActivationOrder(ActivationHistoryOrder)

    Basically i am trying to get the un saved QMdiSubWindows and close them one by one based on ActivationHistoryOrder and some other condition

    Why QMdiArea is loosing current subwindow focus when i bring DialogBox?.

  • Why you need focus? You can obtain unsaved documents by iterating over all child windows and checking their dirty flag (isWindowModified).

  • Thanks for reply. actually its my mistake and i resolved it

Log in to reply