aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2/QtGui
diff options
context:
space:
mode:
Diffstat (limited to 'sources/pyside2/PySide2/QtGui')
-rw-r--r--sources/pyside2/PySide2/QtGui/glue/qguiapplication_init.cpp36
-rw-r--r--sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml3
2 files changed, 8 insertions, 31 deletions
diff --git a/sources/pyside2/PySide2/QtGui/glue/qguiapplication_init.cpp b/sources/pyside2/PySide2/QtGui/glue/qguiapplication_init.cpp
index 014e409b5..38a4c1ccb 100644
--- a/sources/pyside2/PySide2/QtGui/glue/qguiapplication_init.cpp
+++ b/sources/pyside2/PySide2/QtGui/glue/qguiapplication_init.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of PySide2.
@@ -37,34 +37,14 @@
**
****************************************************************************/
-// Borrowed reference to QtGui module
-extern PyObject* moduleQtGui;
-
-static int QGuiApplicationArgCount;
-static char** QGuiApplicationArgValues;
-
-bool QGuiApplicationConstructorStart(PyObject* argv)
-{
- if (QGuiApplication::instance()) {
- PyErr_SetString(PyExc_RuntimeError, "A QGuiApplication instance already exists.");
- return false;
- }
-
- return Shiboken::listToArgcArgv(argv, &QGuiApplicationArgCount, &QGuiApplicationArgValues, "PySideApp");
-}
-
-void QGuiApplicationConstructorEnd(PyObject* self)
-{
- PySide::registerCleanupFunction(&PySide::destroyQCoreApplication);
- Py_INCREF(self);
-}
-
-static void QGuiApplicationConstructor(PyObject* self, PyObject* argv, QGuiApplicationWrapper** cptr)
+static void QGuiApplicationConstructor(PyObject *self, PyObject *pyargv, QGuiApplicationWrapper **cptr)
{
- PyObject *stringlist = PyTuple_GET_ITEM(argv, 0);
- if (QGuiApplicationConstructorStart(stringlist)) {
- *cptr = new QGuiApplicationWrapper(QGuiApplicationArgCount, QGuiApplicationArgValues, 0);
+ static int argc;
+ static char **argv;
+ PyObject *stringlist = PyTuple_GET_ITEM(pyargv, 0);
+ if (Shiboken::listToArgcArgv(stringlist, &argc, &argv, "PySideApp")) {
+ *cptr = new QGuiApplicationWrapper(argc, argv, 0);
Shiboken::Object::releaseOwnership(reinterpret_cast<SbkObject*>(self));
- QGuiApplicationConstructorEnd(self);
+ PySide::registerCleanupFunction(&PySide::destroyQCoreApplication);
}
}
diff --git a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml
index 0dad0b455..55bc438be 100644
--- a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml
+++ b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml
@@ -3220,10 +3220,7 @@
<!-- Qt5: not sure if this needs support, skipped for now -->
<rejection class="QWindow" function-name="nativeEvent"/>"
- <!-- Qt5: here the new QGuiApplication and related things -->
<object-type name="QGuiApplication">
- <!-- Qt5: gone <enum-type name="ColorSpec"/> -->
- <!-- Qt5: gone <enum-type name="Type"/> -->
<extra-includes>
<include file-name="QBasicTimer" location="global"/>
<include file-name="QFont" location="global"/>