From a31aeca8299e588fd87699082cd1a48769f59a79 Mon Sep 17 00:00:00 2001 From: yorikvanhavre Date: Fri, 16 Dec 2011 13:03:10 +0000 Subject: [PATCH] + 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 --- src/Mod/Draft/DraftGui.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Mod/Draft/DraftGui.py b/src/Mod/Draft/DraftGui.py index 931636cb50..48387bc6c3 100644 --- a/src/Mod/Draft/DraftGui.py +++ b/src/Mod/Draft/DraftGui.py @@ -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: