+ fixed 'No main Window' bug in Draft

git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5315 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
yorikvanhavre 2011-12-16 13:03:10 +00:00
parent 040a5c16cd
commit a31aeca829

View File

@ -43,14 +43,9 @@ def getMainWindow():
# widget than the mainwindow is active (e.g. a dialog) the wrong widget is
# returned
toplevel = QtGui.qApp.topLevelWidgets()
wins = []
for i in toplevel:
if i.metaObject().className() == "Gui::MainWindow":
wins.append(i)
if wins:
for w in wins:
if w.findChildren(QtGui.QWidget,"QtGLArea"):
return w
return i
raise Exception("No main window found")
class todo: