diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-07-02 15:37:05 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-07-02 15:37:05 +0200 |
commit | a883b9301cc189b40ceb5bcfbb75f98aab1b1778 (patch) | |
tree | 20f8d392314430010bcb1f34a2ca227b5bd497ea /sources/shiboken2 | |
parent | b2b5c8c274afaccbaef4437da8932364b9f07dbf (diff) | |
parent | 423f12bb6908667e34a477ccf515a2377fc7a596 (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I79d2166f18d8ed941c6c34fcbc7b185c2da02f0c
Diffstat (limited to 'sources/shiboken2')
-rw-r--r-- | sources/shiboken2/libshiboken/qapp_macro.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sources/shiboken2/libshiboken/qapp_macro.cpp b/sources/shiboken2/libshiboken/qapp_macro.cpp index df24a8052..12af9613c 100644 --- a/sources/shiboken2/libshiboken/qapp_macro.cpp +++ b/sources/shiboken2/libshiboken/qapp_macro.cpp @@ -240,11 +240,13 @@ NotifyModuleForQApp(PyObject *module, void *qApp) * Therefore, the implementation is very simple and just redirects the * qApp_contents variable and assigns the instance, instead of vice-versa. */ - if (qApp != nullptr) { - Shiboken::AutoDecRef pycore(PyImport_ImportModule("PySide2.QtCore")); - Shiboken::AutoDecRef coreapp(PyObject_GetAttrString(pycore, "QCoreApplication")); - qApp_content = PyObject_CallMethod(coreapp, "instance", ""); - reset_qApp_var(); + PyObject *coreDict = qApp_moduledicts[1]; + if (qApp != nullptr && coreDict != nullptr) { + PyObject *coreApp = PyDict_GetItemString(coreDict, "QCoreApplication"); + if (coreApp != nullptr) { + qApp_content = PyObject_CallMethod(coreApp, "instance", ""); + reset_qApp_var(); + } } } |