diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2011-12-12 17:46:37 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-08 16:56:21 -0300 |
commit | 2a634aea05487732fe06c2935dc2893f75af79ed (patch) | |
tree | c1bb71f9ddea64effb67ffd0925835e40ba66fa9 | |
parent | 7bfbbf3cb784f8e22dde74ebe28ba5e5eda4b7db (diff) |
Updated the custom widget plugin to use the new converters.
-rw-r--r-- | plugins/CMakeLists.txt | 2 | ||||
-rw-r--r-- | plugins/customwidget.cpp | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index b17dbc29..a65a4219 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 fb849f20..d573ef43 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; } - |