summaryrefslogtreecommitdiffstats
path: root/PySide
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-06-16 17:00:27 -0300
committerRenato Filho <renato.filho@openbossa.org>2011-06-17 11:16:43 -0300
commitdb40ec67b10e50310dea7d8b9a1bb5c734c232ba (patch)
treefecee22ef992ab80d2ebd7ce1fcb5a7c6989bf3f /PySide
parent2b1df1698cb6df77229fcfc9a8422bc9e28a1b62 (diff)
downloadpyside-db40ec67b10e50310dea7d8b9a1bb5c734c232ba.tar.gz
pyside-db40ec67b10e50310dea7d8b9a1bb5c734c232ba.tar.xz
pyside-db40ec67b10e50310dea7d8b9a1bb5c734c232ba.zip
Fill qApp is any QApplication is active during the QtGui moude import.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Hugo Parente Lima <hugo.pl@gmail.com>
Diffstat (limited to 'PySide')
-rw-r--r--PySide/QtGui/glue/qtgui_qapp.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/PySide/QtGui/glue/qtgui_qapp.cpp b/PySide/QtGui/glue/qtgui_qapp.cpp
index f893f8e..4c4508b 100644
--- a/PySide/QtGui/glue/qtgui_qapp.cpp
+++ b/PySide/QtGui/glue/qtgui_qapp.cpp
@@ -1,4 +1,10 @@
// Init qApp macro to None.
-Py_INCREF(Py_None);
-PyModule_AddObject(module, "qApp", Py_None);
+if (qApp) {
+ PyObject* pyApp = Shiboken::Converter<QApplication*>::toPython(qApp);
+ Py_INCREF(pyApp);
+ PyModule_AddObject(module, "qApp", pyApp);
+} else {
+ Py_INCREF(Py_None);
+ PyModule_AddObject(module, "qApp", Py_None);
+}
moduleQtGui = module;