aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2/PySide2/glue/qtwidgets.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-07-03 08:24:42 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-07-03 13:42:12 +0200
commit3dd32863337ea2f6308ebf2f7656795d3fd488c9 (patch)
tree08a3b35607dee19536ccb5f21b2ede0fdc41cc79 /sources/pyside2/PySide2/glue/qtwidgets.cpp
parent4f4f1be9f46e02e87357aeee613cfd5ea0be8220 (diff)
parent67d635fe2cc2c89c30486a2e26dea4106a9d9c16 (diff)
Merge "Merge remote-tracking branch 'origin/5.13' into dev"
Diffstat (limited to 'sources/pyside2/PySide2/glue/qtwidgets.cpp')
-rw-r--r--sources/pyside2/PySide2/glue/qtwidgets.cpp201
1 files changed, 99 insertions, 102 deletions
diff --git a/sources/pyside2/PySide2/glue/qtwidgets.cpp b/sources/pyside2/PySide2/glue/qtwidgets.cpp
index b44be183d..0e0b025a6 100644
--- a/sources/pyside2/PySide2/glue/qtwidgets.cpp
+++ b/sources/pyside2/PySide2/glue/qtwidgets.cpp
@@ -44,13 +44,13 @@
// @snippet qtreewidgetitemiterator-next
if (**%CPPSELF) {
QTreeWidgetItemIterator *%0 = new QTreeWidgetItemIterator((*%CPPSELF)++);
- %PYARG_0 = %CONVERTTOPYTHON[QTreeWidgetItemIterator*](%0);
+ %PYARG_0 = %CONVERTTOPYTHON[QTreeWidgetItemIterator *](%0);
}
// @snippet qtreewidgetitemiterator-next
// @snippet qtreewidgetitemiterator-value
-QTreeWidgetItem *%0 = %CPPSELF.operator*();
-%PYARG_0 = %CONVERTTOPYTHON[QTreeWidgetItem*](%0);
+QTreeWidgetItem *%0 = %CPPSELF.operator *();
+%PYARG_0 = %CONVERTTOPYTHON[QTreeWidgetItem *](%0);
Shiboken::Object::releaseOwnership(%PYARG_0);
// @snippet qtreewidgetitemiterator-value
@@ -62,7 +62,7 @@ PyDict_SetItemString(reinterpret_cast<PyTypeObject *>(Sbk_QGraphicsItem_TypeF())
// @snippet qgraphicsitem-scene-return-parenting
if (%0) {
QObject *parent = %0->parent();
- Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QObject*](parent));
+ Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QObject *](parent));
Shiboken::Object::setParent(pyParent, %PYARG_0);
}
// @snippet qgraphicsitem-scene-return-parenting
@@ -72,7 +72,7 @@ QGraphicsItem *item_ = NULL;
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&item_);
%PYARG_0 = PyTuple_New(2);
PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_));
-PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QGraphicsItem*](item_));
+PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QGraphicsItem *](item_));
// @snippet qgraphicsitem-isblockedbymodalpanel
// @snippet qitemeditorfactory-registereditor
@@ -81,7 +81,7 @@ Shiboken::Object::releaseOwnership(%PYARG_2);
// @snippet qitemeditorfactory-setdefaultfactory
//this function is static we need keep ref to default value, to be able to call python virtual functions
-static PyObject* _defaultValue = 0;
+static PyObject *_defaultValue = nullptr;
%CPPSELF.%FUNCTION_NAME(%1);
Py_INCREF(%PYARG_1);
if (_defaultValue)
@@ -111,9 +111,9 @@ PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[%ARG5_TYPE](%5));
// @snippet qfiledialog-return
// @snippet qmenu-glue
-inline PyObject* addActionWithPyObject(QMenu* self, const QIcon& icon, const QString& text, PyObject* callback, const QKeySequence& shortcut)
+inline PyObject *addActionWithPyObject(QMenu *self, const QIcon &icon, const QString &text, PyObject *callback, const QKeySequence &shortcut)
{
- QAction* act = self->addAction(text);
+ QAction *act = self->addAction(text);
if (!icon.isNull())
act->setIcon(icon);
@@ -123,7 +123,7 @@ inline PyObject* addActionWithPyObject(QMenu* self, const QIcon& icon, const QSt
self->addAction(act);
- PyObject* pyAct = %CONVERTTOPYTHON[QAction*](act);
+ PyObject *pyAct = %CONVERTTOPYTHON[QAction *](act);
Shiboken::AutoDecRef result(PyObject_CallMethod(pyAct,
const_cast<char *>("connect"),
const_cast<char *>("OsO"),
@@ -151,7 +151,7 @@ inline PyObject* addActionWithPyObject(QMenu* self, const QIcon& icon, const QSt
// @snippet qmenu-addaction-3
// @snippet qmenu-clear
-Shiboken::BindingManager& bm = Shiboken::BindingManager::instance();
+Shiboken::BindingManager &bm = Shiboken::BindingManager::instance();
const auto &actions = %CPPSELF.actions();
for (auto *act : actions) {
if (auto wrapper = bm.retrieveWrapper(act)) {
@@ -165,15 +165,15 @@ for (auto *act : actions) {
// @snippet qmenu-clear
// @snippet qmenubar-glue
-inline PyObject*
-addActionWithPyObject(QMenuBar* self, const QString& text, PyObject* callback)
+inline PyObject *
+addActionWithPyObject(QMenuBar *self, const QString &text, PyObject *callback)
{
- QAction* act = self->addAction(text);
+ QAction *act = self->addAction(text);
self->addAction(act);
- PyObject* pyAct = %CONVERTTOPYTHON[QAction*](act);
- PyObject* result = PyObject_CallMethod(pyAct,
+ PyObject *pyAct = %CONVERTTOPYTHON[QAction *](act);
+ PyObject *result = PyObject_CallMethod(pyAct,
const_cast<char *>("connect"),
const_cast<char *>("OsO"),
pyAct,
@@ -193,7 +193,7 @@ addActionWithPyObject(QMenuBar* self, const QString& text, PyObject* callback)
// @snippet qmenubar-clear
const auto &actions = %CPPSELF.actions();
for (auto *act : actions) {
- Shiboken::AutoDecRef pyAct(%CONVERTTOPYTHON[QAction*](act));
+ Shiboken::AutoDecRef pyAct(%CONVERTTOPYTHON[QAction *](act));
Shiboken::Object::setParent(NULL, pyAct);
Shiboken::Object::invalidate(pyAct);
}
@@ -224,28 +224,28 @@ if (!result.isNull())
// @snippet qtoolbox-removeitem
QWidget *_widget = %CPPSELF.widget(%1);
if (_widget) {
- Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](_widget));
+ Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget *](_widget));
Shiboken::Object::setParent(0, pyWidget);
}
// @snippet qtoolbox-removeitem
// @snippet qlayout-help-functions
-void addLayoutOwnership(QLayout* layout, QLayoutItem* item);
-void removeLayoutOwnership(QLayout* layout, QWidget* widget);
+void addLayoutOwnership(QLayout *layout, QLayoutItem *item);
+void removeLayoutOwnership(QLayout *layout, QWidget *widget);
-inline QByteArray retrieveObjectName(PyObject* obj)
+inline QByteArray retrieveObjectName(PyObject *obj)
{
Shiboken::AutoDecRef objName(PyObject_Str(obj));
return Shiboken::String::toCString(objName);
}
-inline void addLayoutOwnership(QLayout* layout, QWidget* widget)
+inline void addLayoutOwnership(QLayout *layout, QWidget *widget)
{
//transfer ownership to parent widget
QWidget *lw = layout->parentWidget();
QWidget *pw = widget->parentWidget();
- Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QWidget*](widget));
+ Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QWidget *](widget));
//Transfer parent to layout widget
if (pw && lw && pw != lw)
@@ -253,99 +253,98 @@ inline void addLayoutOwnership(QLayout* layout, QWidget* widget)
if (!lw && !pw) {
//keep the reference while the layout is orphan
- Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QWidget*](layout));
- Shiboken::Object::keepReference(reinterpret_cast<SbkObject*>(pyParent.object()), retrieveObjectName(pyParent).data(), pyChild, true);
+ Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QWidget *](layout));
+ Shiboken::Object::keepReference(reinterpret_cast<SbkObject *>(pyParent.object()), retrieveObjectName(pyParent).data(), pyChild, true);
} else {
if (!lw)
lw = pw;
- Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QWidget*](lw));
+ Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QWidget *](lw));
Shiboken::Object::setParent(pyParent, pyChild);
}
}
-inline void addLayoutOwnership(QLayout* layout, QLayout* other)
+inline void addLayoutOwnership(QLayout *layout, QLayout *other)
{
//transfer all children widgets from other to layout parent widget
- QWidget* parent = layout->parentWidget();
+ QWidget *parent = layout->parentWidget();
if (!parent) {
//keep the reference while the layout is orphan
- Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QLayout*](layout));
- Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QLayout*](other));
- Shiboken::Object::keepReference(reinterpret_cast<SbkObject*>(pyParent.object()), retrieveObjectName(pyParent).data(), pyChild, true);
+ Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QLayout *](layout));
+ Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QLayout *](other));
+ Shiboken::Object::keepReference(reinterpret_cast<SbkObject *>(pyParent.object()),
+ retrieveObjectName(pyParent).data(), pyChild, true);
return;
}
for (int i=0, i_max=other->count(); i < i_max; i++) {
- QLayoutItem* item = other->itemAt(i);
+ QLayoutItem *item = other->itemAt(i);
if (PyErr_Occurred() || !item)
return;
addLayoutOwnership(layout, item);
}
- Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QLayout*](layout));
- Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QLayout*](other));
+ Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QLayout *](layout));
+ Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QLayout *](other));
Shiboken::Object::setParent(pyParent, pyChild);
}
-inline void addLayoutOwnership(QLayout* layout, QLayoutItem* item)
+inline void addLayoutOwnership(QLayout *layout, QLayoutItem *item)
{
if (!item)
return;
- QWidget* w = item->widget();
- if (w)
+ if (QWidget *w = item->widget()) {
addLayoutOwnership(layout, w);
- else {
- QLayout* l = item->layout();
- if (l)
+ } else {
+ if (QLayout *l = item->layout())
addLayoutOwnership(layout, l);
}
- Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QLayout*](layout));
- Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QLayoutItem*](item));
+ Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QLayout *](layout));
+ Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QLayoutItem *](item));
Shiboken::Object::setParent(pyParent, pyChild);
}
-static void removeWidgetFromLayout(QLayout* layout, QWidget* widget)
+static void removeWidgetFromLayout(QLayout *layout, QWidget *widget)
{
- QWidget* parent = widget->parentWidget();
+ QWidget *parent = widget->parentWidget();
if (!parent) {
//remove reference on layout
- Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QWidget*](layout));
- Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QWidget*](widget));
- Shiboken::Object::removeReference(reinterpret_cast<SbkObject*>(pyParent.object()), retrieveObjectName(pyParent).data(), pyChild);
+ Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QWidget *](layout));
+ Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QWidget *](widget));
+ Shiboken::Object::removeReference(reinterpret_cast<SbkObject *>(pyParent.object()),
+ retrieveObjectName(pyParent).data(), pyChild);
} else {
//give the ownership to parent
- Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QWidget*](parent));
- Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QWidget*](widget));
+ Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QWidget *](parent));
+ Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QWidget *](widget));
Shiboken::Object::setParent(pyParent, pyChild);
}
}
-inline void removeLayoutOwnership(QLayout* layout, QLayoutItem* item)
+inline void removeLayoutOwnership(QLayout *layout, QLayoutItem *item)
{
- QWidget* w = item->widget();
- if (w)
+ if (QWidget *w = item->widget()) {
removeWidgetFromLayout(layout, w);
- else {
- QLayout* l = item->layout();
+ } else {
+ QLayout *l = item->layout();
if (l && item != l)
removeLayoutOwnership(layout, l);
}
- Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QLayoutItem*](item));
+ Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QLayoutItem *](item));
Shiboken::Object::invalidate(pyChild);
Shiboken::Object::setParent(0, pyChild);
}
-inline void removeLayoutOwnership(QLayout* layout, QWidget* widget)
+inline void removeLayoutOwnership(QLayout *layout, QWidget *widget)
{
if (!widget)
return;
for (int i=0, i_max=layout->count(); i < i_max; i++) {
- QLayoutItem* item = layout->itemAt(i);
+ QLayoutItem *item = layout->itemAt(i);
if (PyErr_Occurred() || !item)
return;
if (item->widget() == widget)
@@ -385,11 +384,11 @@ PyTuple_SET_ITEM(%PYARG_0, 3, %CONVERTTOPYTHON[int](d));
// @snippet qgridlayout-getitemposition
// @snippet qgraphicsscene-destroyitemgroup
-QGraphicsItem* parentItem = %1->parentItem();
-Shiboken::AutoDecRef parent(%CONVERTTOPYTHON[QGraphicsItem*](parentItem));
+QGraphicsItem *parentItem = %1->parentItem();
+Shiboken::AutoDecRef parent(%CONVERTTOPYTHON[QGraphicsItem *](parentItem));
const auto &childItems = %1->childItems();
for (auto *item : childItems)
- Shiboken::Object::setParent(parent, %CONVERTTOPYTHON[QGraphicsItem*](item));
+ Shiboken::Object::setParent(parent, %CONVERTTOPYTHON[QGraphicsItem *](item));
%BEGIN_ALLOW_THREADS
%CPPSELF.%FUNCTION_NAME(%1);
%END_ALLOW_THREADS
@@ -400,16 +399,16 @@ Shiboken::Object::invalidate(%PYARG_1);
// @snippet qgraphicsscene-addwidget
%RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(%1, %2);
%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
-Shiboken::Object::keepReference((SbkObject*)%PYARG_0, "setWidget(QWidget*)1", %PYARG_1);
+Shiboken::Object::keepReference(reinterpret_cast<SbkObject *>(%PYARG_0), "setWidget(QWidget*)1", %PYARG_1);
// @snippet qgraphicsscene-addwidget
// @snippet qgraphicsscene-clear
-const QList<QGraphicsItem*> items = %CPPSELF.items();
-Shiboken::BindingManager& bm = Shiboken::BindingManager::instance();
+const QList<QGraphicsItem *> items = %CPPSELF.items();
+Shiboken::BindingManager &bm = Shiboken::BindingManager::instance();
for (auto *item : items) {
- SbkObject* obj = bm.retrieveWrapper(item);
+ SbkObject *obj = bm.retrieveWrapper(item);
if (obj) {
- if (reinterpret_cast<PyObject*>(obj)->ob_refcnt > 1) // If the refcnt is 1 the object will vannish anyway.
+ if (reinterpret_cast<PyObject *>(obj)->ob_refcnt > 1) // If the refcnt is 1 the object will vannish anyway.
Shiboken::Object::invalidate(obj);
Shiboken::Object::removeParent(obj);
}
@@ -422,9 +421,8 @@ QTreeWidgetItem *rootItem = %CPPSELF.invisibleRootItem();
Shiboken::BindingManager &bm = Shiboken::BindingManager::instance();
for (int i = 0, i_count = rootItem->childCount(); i < i_count; ++i) {
QTreeWidgetItem *item = rootItem->child(i);
- SbkObject* wrapper = bm.retrieveWrapper(item);
- if (wrapper)
- Shiboken::Object::setParent(0, reinterpret_cast<PyObject*>(wrapper));
+ if (SbkObject *wrapper = bm.retrieveWrapper(item))
+ Shiboken::Object::setParent(nullptr, reinterpret_cast<PyObject *>(wrapper));
}
// @snippet qtreewidget-clear
@@ -440,7 +438,7 @@ Shiboken::BindingManager &bm = Shiboken::BindingManager::instance();
for (int i = 0, count = %CPPSELF.count(); i < count; ++i) {
QListWidgetItem *item = %CPPSELF.item(i);
if (auto wrapper = bm.retrieveWrapper(item)) {
- auto pyObj = reinterpret_cast<PyObject*>(wrapper);
+ auto pyObj = reinterpret_cast<PyObject *>(wrapper);
Py_INCREF(pyObj);
Shiboken::Object::setParent(NULL, pyObj);
Shiboken::Object::invalidate(pyObj);
@@ -461,31 +459,30 @@ static QString retrieveObjectName(PyObject *obj)
// Transfer objects ownership from layout to widget
static inline void qwidgetReparentLayout(QWidget *parent, QLayout *layout)
{
- Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QWidget*](parent));
+ Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QWidget *](parent));
for (int i=0, i_count = layout->count(); i < i_count; i++) {
- QLayoutItem* item = layout->itemAt(i);
+ QLayoutItem *item = layout->itemAt(i);
if (PyErr_Occurred() || !item)
return;
- QWidget* w = item->widget();
- if (w) {
- QWidget* pw = w->parentWidget();
+ if (QWidget *w = item->widget()) {
+ QWidget *pw = w->parentWidget();
if (pw != parent) {
- Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QWidget*](w));
+ Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QWidget *](w));
Shiboken::Object::setParent(pyParent, pyChild);
}
} else {
- QLayout* l = item->layout();
- if (l)
+ if (QLayout *l = item->layout())
qwidgetReparentLayout(parent, l);
}
}
- Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QLayout*](layout));
+ Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QLayout *](layout));
Shiboken::Object::setParent(pyParent, pyChild);
//remove previous references
- Shiboken::Object::keepReference(reinterpret_cast<SbkObject*>(pyChild.object()), qPrintable(retrieveObjectName(pyChild)), Py_None);
+ Shiboken::Object::keepReference(reinterpret_cast<SbkObject *>(pyChild.object()),
+ qPrintable(retrieveObjectName(pyChild)), Py_None);
}
static inline void qwidgetSetLayout(QWidget *self, QLayout *layout)
@@ -493,11 +490,11 @@ static inline void qwidgetSetLayout(QWidget *self, QLayout *layout)
if (!layout || self->layout())
return;
- QObject* oldParent = layout->parent();
+ QObject *oldParent = layout->parent();
if (oldParent && oldParent != self) {
if (oldParent->isWidgetType()) {
// remove old parent policy
- Shiboken::AutoDecRef pyLayout(%CONVERTTOPYTHON[QLayout*](layout));
+ Shiboken::AutoDecRef pyLayout(%CONVERTTOPYTHON[QLayout *](layout));
Shiboken::Object::setParent(Py_None, pyLayout);
} else {
PyErr_Format(PyExc_RuntimeError, "QWidget::setLayout: Attempting to set QLayout \"%s\" on %s \"%s\", when the QLayout already has a parent",
@@ -517,20 +514,20 @@ static inline void qwidgetSetLayout(QWidget *self, QLayout *layout)
// @snippet qwidget-glue
// @snippet qwidget-setstyle
-Shiboken::Object::keepReference(reinterpret_cast<SbkObject*>(%PYSELF), "__style__", %PYARG_1);
+Shiboken::Object::keepReference(reinterpret_cast<SbkObject *>(%PYSELF), "__style__", %PYARG_1);
// @snippet qwidget-setstyle
// @snippet qwidget-style
-QStyle* myStyle = %CPPSELF->style();
+QStyle *myStyle = %CPPSELF->style();
if (myStyle && qApp) {
-%PYARG_0 = %CONVERTTOPYTHON[QStyle*](myStyle);
+%PYARG_0 = %CONVERTTOPYTHON[QStyle *](myStyle);
QStyle *appStyle = qApp->style();
if (appStyle == myStyle) {
- Shiboken::AutoDecRef pyApp(%CONVERTTOPYTHON[QApplication*](qApp));
+ Shiboken::AutoDecRef pyApp(%CONVERTTOPYTHON[QApplication *](qApp));
Shiboken::Object::setParent(pyApp, %PYARG_0);
Shiboken::Object::releaseOwnership(%PYARG_0);
} else {
- Shiboken::Object::keepReference(reinterpret_cast<SbkObject*>(%PYSELF), "__style__", %PYARG_0);
+ Shiboken::Object::keepReference(reinterpret_cast<SbkObject *>(%PYSELF), "__style__", %PYARG_0);
}
}
// @snippet qwidget-style
@@ -543,7 +540,7 @@ static void QApplicationConstructor(PyObject *self, PyObject *pyargv, QApplicati
PyObject *stringlist = PyTuple_GET_ITEM(pyargv, 0);
if (Shiboken::listToArgcArgv(stringlist, &argc, &argv, "PySideApp")) {
*cptr = new QApplicationWrapper(argc, argv, 0);
- Shiboken::Object::releaseOwnership(reinterpret_cast<SbkObject*>(self));
+ Shiboken::Object::releaseOwnership(reinterpret_cast<SbkObject *>(self));
PySide::registerCleanupFunction(&PySide::destroyQCoreApplication);
}
}
@@ -551,7 +548,7 @@ static void QApplicationConstructor(PyObject *self, PyObject *pyargv, QApplicati
// @snippet qapplication-setStyle
if (qApp) {
- Shiboken::AutoDecRef pyApp(%CONVERTTOPYTHON[QApplication*](qApp));
+ Shiboken::AutoDecRef pyApp(%CONVERTTOPYTHON[QApplication *](qApp));
Shiboken::Object::setParent(pyApp, %PYARG_1);
Shiboken::Object::releaseOwnership(%PYARG_1);
}
@@ -563,19 +560,19 @@ qwidgetSetLayout(%CPPSELF, %1);
// @snippet qwidget-setlayout
// @snippet qtabwidget-removetab
-QWidget* tab = %CPPSELF.widget(%1);
+QWidget *tab = %CPPSELF.widget(%1);
if (tab) {
- Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](tab));
+ Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget *](tab));
%CPPSELF.%FUNCTION_NAME(%1);
}
// @snippet qtabwidget-removetab
// @snippet qtabwidget-clear
-Shiboken::BindingManager& bm = Shiboken::BindingManager::instance();
+Shiboken::BindingManager &bm = Shiboken::BindingManager::instance();
for (int i = 0, count = %CPPSELF.count(); i < count; ++i) {
- QWidget* widget = %CPPSELF.widget(i);
+ QWidget *widget = %CPPSELF.widget(i);
if (bm.hasWrapper(widget)) {
- Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](widget));
+ Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget *](widget));
Shiboken::Object::releaseOwnership(pyWidget);
}
}
@@ -588,7 +585,7 @@ for (int i = 0, count = %CPPSELF.count(); i < count; ++i) {
// @snippet qtoolbar-addaction-1
QAction *action = %CPPSELF.addAction(%1, %2);
-%PYARG_0 = %CONVERTTOPYTHON[QAction*](action);
+%PYARG_0 = %CONVERTTOPYTHON[QAction *](action);
Shiboken::AutoDecRef result(PyObject_CallMethod(%PYARG_0,
const_cast<char *>("connect"),
const_cast<char *>("OsO"),
@@ -598,7 +595,7 @@ Shiboken::AutoDecRef result(PyObject_CallMethod(%PYARG_0,
// @snippet qtoolbar-addaction-2
QAction *action = %CPPSELF.addAction(%1);
-%PYARG_0 = %CONVERTTOPYTHON[QAction*](action);
+%PYARG_0 = %CONVERTTOPYTHON[QAction *](action);
Shiboken::AutoDecRef result(PyObject_CallMethod(%PYARG_0,
const_cast<char *>("connect"),
const_cast<char *>("OsO"),
@@ -611,12 +608,12 @@ Shiboken::AutoDecRef result(PyObject_CallMethod(%PYARG_0,
// @snippet qtoolbar-addaction-3
// @snippet qtoolbar-clear
-QList<PyObject* > lst;
-Shiboken::BindingManager& bm = Shiboken::BindingManager::instance();
-const auto &toolButtonChildren = %CPPSELF.findChildren<QToolButton*>();
+QList<PyObject *> lst;
+Shiboken::BindingManager &bm = Shiboken::BindingManager::instance();
+const auto &toolButtonChildren = %CPPSELF.findChildren<QToolButton *>();
for (auto *child : toolButtonChildren) {
if (bm.hasWrapper(child)) {
- PyObject* pyChild = %CONVERTTOPYTHON[QToolButton*](child);
+ PyObject *pyChild = %CONVERTTOPYTHON[QToolButton *](child);
Shiboken::Object::setParent(0, pyChild);
lst << pyChild;
}
@@ -625,14 +622,14 @@ for (auto *child : toolButtonChildren) {
//Remove actions
const auto &actions = %CPPSELF.actions();
for (auto *act : actions) {
- Shiboken::AutoDecRef pyAct(%CONVERTTOPYTHON[QAction*](act));
+ Shiboken::AutoDecRef pyAct(%CONVERTTOPYTHON[QAction *](act));
Shiboken::Object::setParent(NULL, pyAct);
Shiboken::Object::invalidate(pyAct);
}
%CPPSELF.clear();
for (auto *obj : lst) {
- Shiboken::Object::invalidate(reinterpret_cast<SbkObject* >(obj));
+ Shiboken::Object::invalidate(reinterpret_cast<SbkObject *>(obj));
Py_XDECREF(obj);
}
// @snippet qtoolbar-clear
@@ -648,9 +645,9 @@ if (!PyTuple_SetItem(empty, 0, PyList_New(0)))
// @snippet qapplication-2
// @snippet qgraphicsproxywidget-setwidget
-QWidget* _old = %CPPSELF.widget();
+QWidget *_old = %CPPSELF.widget();
if (_old)
- Shiboken::Object::setParent(nullptr, %CONVERTTOPYTHON[QWidget*](_old));
+ Shiboken::Object::setParent(nullptr, %CONVERTTOPYTHON[QWidget *](_old));
%CPPSELF.%FUNCTION_NAME(%1);
Shiboken::Object::setParent(%PYSELF, %PYARG_1);
// @snippet qgraphicsproxywidget-setwidget