diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-07-03 08:24:42 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2019-07-03 13:42:12 +0200 |
commit | 3dd32863337ea2f6308ebf2f7656795d3fd488c9 (patch) | |
tree | 08a3b35607dee19536ccb5f21b2ede0fdc41cc79 /sources/pyside2/plugins/customwidget.cpp | |
parent | 4f4f1be9f46e02e87357aeee613cfd5ea0be8220 (diff) | |
parent | 67d635fe2cc2c89c30486a2e26dea4106a9d9c16 (diff) |
Merge "Merge remote-tracking branch 'origin/5.13' into dev"
Diffstat (limited to 'sources/pyside2/plugins/customwidget.cpp')
-rw-r--r-- | sources/pyside2/plugins/customwidget.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/sources/pyside2/plugins/customwidget.cpp b/sources/pyside2/plugins/customwidget.cpp index f3ce09b62..6a6d7a3be 100644 --- a/sources/pyside2/plugins/customwidget.cpp +++ b/sources/pyside2/plugins/customwidget.cpp @@ -43,11 +43,11 @@ struct PyCustomWidgetPrivate { - PyObject* pyObject; + PyObject *pyObject; bool initialized; }; -PyCustomWidget::PyCustomWidget(PyObject* objectType) +PyCustomWidget::PyCustomWidget(PyObject *objectType) : m_data(new PyCustomWidgetPrivate()) { m_data->pyObject = objectType; @@ -104,13 +104,13 @@ QString PyCustomWidget::whatsThis() const return QString(); } -QWidget* PyCustomWidget::createWidget(QWidget* parent) +QWidget *PyCustomWidget::createWidget(QWidget *parent) { //Create a python instance and return cpp object - PyObject* pyParent; + PyObject *pyParent; bool unkowParent = false; if (parent) { - pyParent = reinterpret_cast<PyObject*>(Shiboken::BindingManager::instance().retrieveWrapper(parent)); + pyParent = reinterpret_cast<PyObject *>(Shiboken::BindingManager::instance().retrieveWrapper(parent)); if (pyParent) { Py_INCREF(pyParent); } else { @@ -127,22 +127,22 @@ QWidget* PyCustomWidget::createWidget(QWidget* parent) PyTuple_SET_ITEM(pyArgs, 0, pyParent); //tuple will keep pyParent reference //Call python constructor - SbkObject* result = reinterpret_cast<SbkObject*>(PyObject_CallObject(m_data->pyObject, pyArgs)); + auto result = reinterpret_cast<SbkObject *>(PyObject_CallObject(m_data->pyObject, pyArgs)); - QWidget* widget = 0; + QWidget *widget = nullptr; if (result) { if (unkowParent) //if parent does not exists in python, transfer the ownership to cpp Shiboken::Object::releaseOwnership(result); else - Shiboken::Object::setParent(pyParent, reinterpret_cast<PyObject*>(result)); + Shiboken::Object::setParent(pyParent, reinterpret_cast<PyObject *>(result)); - widget = reinterpret_cast<QWidget*>(Shiboken::Object::cppPointer(result, Py_TYPE(result))); + widget = reinterpret_cast<QWidget *>(Shiboken::Object::cppPointer(result, Py_TYPE(result))); } return widget; } -void PyCustomWidget::initialize(QDesignerFormEditorInterface* core) +void PyCustomWidget::initialize(QDesignerFormEditorInterface *core) { m_data->initialized = true; } |