I am currently writing a pyqt5 application with several widgets using a qmdiarea and mdisubwindows. I have a main subwindow showing an image and several widgets associated to that main subwindow. Eventually, I want to get rid of all accesory widgets. Although I receive a warning message, not an error, I would like to get rid of this warning message.
This is the way I create the Subwindows and how I close them:
Subwindow Creation:
self.LUTobj = QMdiSubWindow()
self.DATAobj = QMdiSubWindow()
self.MEASUREobj = QMdiSubWindow()
self.REFERENCEobj = QMdiSubWindow()
self.SPATIALRESOLobj= QMdiSubWindow()
self.LINEPROFILEobj = QMdiSubWindow()
self.SNRobj = QMdiSubWindow()
self.CNRobj = QMdiSubWindow()
Subwindow delete:
def closeSubwindowObject(self):
if self.LUTobj is not None:
self.mdiArea.removeSubWindow (self.LUTobj)
if self.DATAobj is not None:
self.mdiArea.removeSubWindow (self.DATAobj)
if self.MEASUREobj is not None:
self.mdiArea.removeSubWindow (self.MEASUREobj)
if self.REFERENCEobj is not None:
self.mdiArea.removeSubWindow (self.REFERENCEobj)
if self.SPATIALRESOLobj is not None:
self.mdiArea.removeSubWindow (self.SPATIALRESOLobj)
if self.LINEPROFILEobj is not None:
self.mdiArea.removeSubWindow (self.LINEPROFILEobj)
if self.SNRobj is not None:
self.mdiArea.removeSubWindow (self.SNRobj)
if self.CNRobj is not None:
self.mdiArea.removeSubWindow (self.CNRobj)
This is the warning message that it is shown:
QMdiArea::removeSubWindow: window is not inside workspace
Any clue on how to check is the window is inside the workspace?