Commit f20f7ea8 authored by Daniel Brown's avatar Daniel Brown
Browse files

fixing QApplication creation for GUI

parent 24535aa5
......@@ -42,6 +42,9 @@ from pykat.components import Component
from pykat.commands import Command, xaxis
from pykat.gui.gui import pyKatGUI
from PyQt4.QtCore import QCoreApplication
from PyQt4.QtGui import QApplication
NO_GUI = False
......@@ -474,12 +477,20 @@ class kat(object):
if NO_GUI:
print "No PyQt4 module was installed so cannot open a GUI"
else: = QCoreApplication.instance()
created = False
if == None:
created = True = QApplication([""])
if self.pykatgui == None: = QtGui.QApplication([""])
self.pykatgui = pyKatGUI(self)
if created:
def getComponents(self):
return self.__components.values()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment