def _closeRunningInstances(self):
'''Check if other instances are already runnign and close them before proceding.'''
for widget in QtGui.QApplication.allWidgets():
name = widget.objectName()
if type(widget) == type(self):
p = widget.parentWidget()
while p:
if p.parent() and isinstance(p.parent(), QtGui.QStackedWidget):
p.parent().removeWidget(p) # THIS ASSUMES NUKE'S QSTACKEDWIDGET HOLDING THIS WIDGET
p = None
else:
p = p.parentWidget()
评论列表
文章目录