aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/pythonextensions/pythonextensions.pro2
-rw-r--r--plugins/pythonextensions/pythonextensionsplugin.cpp4
-rw-r--r--plugins/pythonextensions/pyutil.cpp11
-rw-r--r--plugins/pythonextensions/pyutil.h2
-rw-r--r--plugins/pythonextensions/typesystem_qtcreator.xml2
5 files changed, 11 insertions, 10 deletions
diff --git a/plugins/pythonextensions/pythonextensions.pro b/plugins/pythonextensions/pythonextensions.pro
index e28b860..334e029 100644
--- a/plugins/pythonextensions/pythonextensions.pro
+++ b/plugins/pythonextensions/pythonextensions.pro
@@ -24,7 +24,7 @@ include($$IDE_SOURCE_TREE/src/qtcreatorplugin.pri)
# Qt Creator Core bindings
WRAPPED_HEADER = $$PWD/wrappedclasses.h
-WRAPPER_DIR = $$OUT_PWD/PythonExtension/QtCreator
+WRAPPER_DIR = $$OUT_PWD/QtCreator
TYPESYSTEM_FILE = typesystem_qtcreator.xml
TYPESYSTEM_NAME = qtcreator
SHIBOKEN_QT = core gui widgets
diff --git a/plugins/pythonextensions/pythonextensionsplugin.cpp b/plugins/pythonextensions/pythonextensionsplugin.cpp
index 893819c..59b32a1 100644
--- a/plugins/pythonextensions/pythonextensionsplugin.cpp
+++ b/plugins/pythonextensions/pythonextensionsplugin.cpp
@@ -188,13 +188,13 @@ void PythonExtensionsPlugin::initializePythonBindings()
QDir().mkpath(pythonPackagePath());
PyUtil::addToSysPath(pythonPackagePath().toStdString());
// Initialize the Python context and register global Qt Creator variable
- if (!PyUtil::bindShibokenModuleObject("PythonExtension", "QtCreator")) {
+ if (!PyUtil::bindCoreModules()) {
qWarning() << "Python bindings could not be initialized";
Core::MessageManager::write(Constants::MESSAGE_MANAGER_PREFIX + tr("Python bindings could not be initialized"));
return;
}
// Bind the plugin instance
- PyUtil::bindObject("PythonExtension", "PluginInstance", PyUtil::PythonExtensionsPluginType, this);
+ PyUtil::bindObject("QtCreator", "PythonExtensions", PyUtil::PythonExtensionsPluginType, this);
}
void PythonExtensionsPlugin::initializeOptionalBindings()
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)
diff --git a/plugins/pythonextensions/pyutil.h b/plugins/pythonextensions/pyutil.h
index 23fdb37..ca58f6e 100644
--- a/plugins/pythonextensions/pyutil.h
+++ b/plugins/pythonextensions/pyutil.h
@@ -53,7 +53,7 @@ PYTHONEXTENSIONSSHARED_EXPORT bool createModule(const std::string &moduleName);
bool bindObject(const QString &moduleName, const QString &name, int index, void *o);
-bool bindShibokenModuleObject(const QString &moduleName, const QString &name);
+bool bindCoreModules();
PYTHONEXTENSIONSSHARED_EXPORT bool bindPyObject(const QString &moduleName, const QString &name, void *obj);
diff --git a/plugins/pythonextensions/typesystem_qtcreator.xml b/plugins/pythonextensions/typesystem_qtcreator.xml
index 49dd794..69f051e 100644
--- a/plugins/pythonextensions/typesystem_qtcreator.xml
+++ b/plugins/pythonextensions/typesystem_qtcreator.xml
@@ -41,7 +41,7 @@
-->
<!-- Typesystem for Qt Creator Python host plugin -->
-<typesystem package="PythonExtension.QtCreator">
+<typesystem package="QtCreator">
<!-- Load PySide QtWidgets typesystem (is this correct? yup) -->
<load-typesystem name="typesystem_widgets.xml" generate="no"/>