moved application creation

This commit is contained in:
Andreas Preikschat 2013-02-16 19:04:17 +01:00
parent d78373e65e
commit fab327c89f
2 changed files with 7 additions and 2 deletions

View File

@ -6,3 +6,8 @@ sip.setapi(u'QTextStream', 2)
sip.setapi(u'QTime', 2) sip.setapi(u'QTime', 2)
sip.setapi(u'QUrl', 2) sip.setapi(u'QUrl', 2)
sip.setapi(u'QVariant', 2) sip.setapi(u'QVariant', 2)
from PyQt4 import QtGui
# Only one QApplication can be created. Use QtGui.QApplication.instance() when you need to "create" a QApplication.
application = QtGui.QApplication([])

View File

@ -26,7 +26,7 @@ class TestPluginManager(TestCase):
Settings().set_filename(self.ini_file) Settings().set_filename(self.ini_file)
Registry.create() Registry.create()
Registry().register(u'service_list', MagicMock()) Registry().register(u'service_list', MagicMock())
self.app = QtGui.QApplication([]) self.app = QtGui.QApplication.instance()
self.main_window = QtGui.QMainWindow() self.main_window = QtGui.QMainWindow()
Registry().register(u'main_window', self.main_window) Registry().register(u'main_window', self.main_window)
self.plugins_dir = os.path.abspath(os.path.join(os.path.basename(__file__), u'..', u'openlp', u'plugins')) self.plugins_dir = os.path.abspath(os.path.join(os.path.basename(__file__), u'..', u'openlp', u'plugins'))