diff options
| author | Eike Ziller <eike.ziller@qt.io> | 2018-09-27 15:00:08 +0200 |
|---|---|---|
| committer | Eike Ziller <eike.ziller@qt.io> | 2018-09-28 07:31:36 +0000 |
| commit | 3412dc563119221bd730c1487937519df0761792 (patch) | |
| tree | d738ea0a24c1013e589e69240d6fc91ae13ed999 /plugins/pythonextensions/pyutil.cpp | |
| parent | 3c4cafdf834c9b683501efca72dbbe1093cf6f9a (diff) | |
Clean up import hierarchy
PythonExtension.QtCreator.*
-> QtCreator.*
PythonExtension.PluginInstance
-> QtCreator.PythonExtensions
Also enables imports of the form "from QtCreator import Core" it is no
longer necessary to write QtCreator.Core....
Change-Id: Ib9b433868dcc3fc7d1d534c6023bae7bf6d05fec
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'plugins/pythonextensions/pyutil.cpp')
| -rw-r--r-- | plugins/pythonextensions/pyutil.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/pythonextensions/pyutil.cpp b/plugins/pythonextensions/pyutil.cpp index b563c55..b992e36 100644 --- a/plugins/pythonextensions/pyutil.cpp +++ b/plugins/pythonextensions/pyutil.cpp @@ -56,10 +56,10 @@ extern "C" void initQtCreator(); // These variables store all Python types exported by QtCreators bindings, // as well as the types exported for QtWidgets. -extern PyTypeObject **SbkPythonExtension_QtCreatorTypes; +extern PyTypeObject **SbkQtCreatorTypes; // This variable stores the Python module generated by Shiboken -extern PyObject *SbkPythonExtension_QtCreatorModuleObject; +extern PyObject *SbkQtCreatorModuleObject; namespace PyUtil { @@ -157,7 +157,7 @@ bool bindObject(const QString &moduleName, const QString &name, int index, void return false; // Generate the type - PyTypeObject *typeObject = SbkPythonExtension_QtCreatorTypes[index]; + PyTypeObject *typeObject = SbkQtCreatorTypes[index]; PyObject *po = Shiboken::Conversions::pointerToPython(reinterpret_cast<SbkObjectType *>(typeObject), o); if (!po) { @@ -169,9 +169,10 @@ bool bindObject(const QString &moduleName, const QString &name, int index, void return bindPyObject(moduleName, name, po); } -bool bindShibokenModuleObject(const QString &moduleName, const QString &name) +bool bindCoreModules() { - return bindPyObject(moduleName, name, SbkPythonExtension_QtCreatorModuleObject); + return bindSubPyObject("QtCreator", "Utils", SbkQtCreatorModuleObject) + && bindSubPyObject("QtCreator", "Core", SbkQtCreatorModuleObject); } bool bindPyObject(const QString &moduleName, const QString &name, void *obj) |
