summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-12-12 17:46:37 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2011-12-12 19:19:40 -0300
commitfe16e86ada6a7ce2b69073d94a20bf56e9e7377b (patch)
treee77b8f0d1691be2a1b07764723137e7f7ccd3794
parent85cf74816ca6a6ff01c9358ed5a586fc36522af1 (diff)
downloadpyside-fe16e86ada6a7ce2b69073d94a20bf56e9e7377b.tar.gz
pyside-fe16e86ada6a7ce2b69073d94a20bf56e9e7377b.tar.xz
pyside-fe16e86ada6a7ce2b69073d94a20bf56e9e7377b.zip
Updated the custom widget plugin to use the new converters.
-rw-r--r--plugins/CMakeLists.txt2
-rw-r--r--plugins/customwidget.cpp10
2 files changed, 6 insertions, 6 deletions
diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
index b17dbc2..a65a421 100644
--- a/plugins/CMakeLists.txt
+++ b/plugins/CMakeLists.txt
@@ -5,7 +5,7 @@ set(ui_plugin_src
customwidget.cpp
)
-set (ui_plugin_moc
+set(ui_plugin_moc
customwidget.h
customwidgets.h
)
diff --git a/plugins/customwidget.cpp b/plugins/customwidget.cpp
index fb849f2..d573ef4 100644
--- a/plugins/customwidget.cpp
+++ b/plugins/customwidget.cpp
@@ -95,11 +95,12 @@ QWidget* PyCustomWidget::createWidget(QWidget* parent)
bool unkowParent = false;
if (parent) {
pyParent = reinterpret_cast<PyObject*>(Shiboken::BindingManager::instance().retrieveWrapper(parent));
- if (!pyParent) {
- pyParent = Shiboken::Converter<QWidget*>::toPython(parent);
- unkowParent = true;
- } else {
+ if (pyParent) {
Py_INCREF(pyParent);
+ } else {
+ static Shiboken::Conversions::SpecificConverter converter("QWidget*");
+ pyParent = converter.toPython(&parent);
+ unkowParent = true;
}
} else {
Py_INCREF(Py_None);
@@ -129,4 +130,3 @@ void PyCustomWidget::initialize(QDesignerFormEditorInterface* core)
{
m_data->initialized = true;
}
-