aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside2
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2019-06-16 12:05:39 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-06-24 11:25:31 +0200
commit380c65e62de0e60da667dc0d87935171b91b9c6c (patch)
tree480c872f247316a66e446ba196a5bd1a339a0bcd /sources/pyside2
parent992ff1f7925009b7ead6d6f005cafcf2e57ed44e (diff)
Cleanup pointer whitespace everywhere
Among other files to fix, basewrapper.(cpp|h) was full of uncommon pointer whitespace. After fixing that, I could not resist and fixed also libshiboken, generators, and after acceptance also PySide. Most of the time, this regex worked fine (\w\w+)([*&]+)[ ]*(?![&*]*[/=]) replaced with \1 \2 but everything was checked by hand. I did not touch the shiboken tests which are quite hairy. It turned out that inserting a space between a variable and asterisk causes a crash of shiboken, if the same line contains "CONVERTTOCPP". This was temporarily fixed by adding another space after it. Example.. sources/pyside2/PySide2/glue/qtcore.cpp line 977 QByteArray * cppSelf = %CONVERTTOCPP[QByteArray *](obj); //XXX /|\ omitting this space crashes shiboken! cppgenerator.cpp was special, since it was modified to _generate_ correct pointer whitespace. This caused a few testcases to fail, which had to be adjusted, again. This was difficult since some internal names must end on "*" and generated code normally not. Removing the last errors involved binary search on path sets... Apply C++ 11 fixits to the changed code, where applicable. Done-with: Friedemann.Kleint@qt.io Task-number: PYSIDE-1037 Change-Id: I4ac070f52c5efb296c05d581c9d46e6f397a6c81 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside2')
-rw-r--r--sources/pyside2/PySide2/QtCore/glue/qeasingcurve_glue.cpp22
-rw-r--r--sources/pyside2/PySide2/QtCore/glue/qeasingcurve_glue.h14
-rw-r--r--sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp70
-rw-r--r--sources/pyside2/PySide2/QtQml/pysideqmlregistertype.h4
-rw-r--r--sources/pyside2/PySide2/QtQuick/pysidequickregistertype.cpp6
-rw-r--r--sources/pyside2/PySide2/QtScript/qscript_value_iterator_glue.cpp2
-rw-r--r--sources/pyside2/PySide2/QtUiTools/glue/plugins.h9
-rw-r--r--sources/pyside2/PySide2/glue/qtcore.cpp207
-rw-r--r--sources/pyside2/PySide2/glue/qtgui.cpp20
-rw-r--r--sources/pyside2/PySide2/glue/qtmultimedia.cpp3
-rw-r--r--sources/pyside2/PySide2/glue/qtopengl.cpp8
-rw-r--r--sources/pyside2/PySide2/glue/qtscript.cpp2
-rw-r--r--sources/pyside2/PySide2/glue/qtuitools.cpp14
-rw-r--r--sources/pyside2/PySide2/glue/qtwebkitwidgets.cpp4
-rw-r--r--sources/pyside2/PySide2/glue/qtwidgets.cpp201
-rw-r--r--sources/pyside2/PySide2/glue/qtxml.cpp4
-rw-r--r--sources/pyside2/PySide2/glue/qtxmlpatterns.cpp4
-rw-r--r--sources/pyside2/PySide2/pysideqtesttouch.h22
-rw-r--r--sources/pyside2/PySide2/qpytextobject.h7
-rw-r--r--sources/pyside2/libpyside/destroylistener.cpp12
-rw-r--r--sources/pyside2/libpyside/destroylistener.h10
-rw-r--r--sources/pyside2/libpyside/globalreceiverv2.cpp52
-rw-r--r--sources/pyside2/libpyside/globalreceiverv2.h16
-rw-r--r--sources/pyside2/libpyside/pyside.cpp88
-rw-r--r--sources/pyside2/libpyside/pyside.h20
-rw-r--r--sources/pyside2/libpyside/pysideclassinfo.cpp36
-rw-r--r--sources/pyside2/libpyside/pysidemetafunction.cpp30
-rw-r--r--sources/pyside2/libpyside/pysidemetafunction.h4
-rw-r--r--sources/pyside2/libpyside/pysidemetafunction_p.h4
-rw-r--r--sources/pyside2/libpyside/pysideproperty.cpp127
-rw-r--r--sources/pyside2/libpyside/pysideqflags.cpp26
-rw-r--r--sources/pyside2/libpyside/pysidesignal.cpp224
-rw-r--r--sources/pyside2/libpyside/pysideslot.cpp24
-rw-r--r--sources/pyside2/libpyside/pysideweakref.cpp14
-rw-r--r--sources/pyside2/libpyside/signalmanager.cpp132
-rw-r--r--sources/pyside2/plugins/customwidget.cpp20
-rw-r--r--sources/pyside2/plugins/customwidgets.cpp11
-rw-r--r--sources/pyside2/tests/pysidetest/hiddenobject.cpp2
38 files changed, 739 insertions, 736 deletions
diff --git a/sources/pyside2/PySide2/QtCore/glue/qeasingcurve_glue.cpp b/sources/pyside2/PySide2/QtCore/glue/qeasingcurve_glue.cpp
index 46a69be31..6629d3c91 100644
--- a/sources/pyside2/PySide2/QtCore/glue/qeasingcurve_glue.cpp
+++ b/sources/pyside2/PySide2/QtCore/glue/qeasingcurve_glue.cpp
@@ -47,13 +47,13 @@
#define __ECF_ATT_NAME__ "__ecf__"
#define MAX_CUSTOM_FUNCTIONS 10
-static void deleteData(void* data);
+static void deleteData(void *data);
struct CustomFunctionsData
{
static CustomFunctionsData m_list[MAX_CUSTOM_FUNCTIONS];
- PySideEasingCurveFunctor* m_obj;
+ PySideEasingCurveFunctor *m_obj;
QEasingCurve::EasingFunction m_func;
};
@@ -95,9 +95,9 @@ struct CustomFunctions<0>
}
};
-void deleteData(void* data)
+void deleteData(void *data)
{
- delete (PySideEasingCurveFunctor*)(data);
+ delete (PySideEasingCurveFunctor *)(data);
}
void PySideEasingCurveFunctor::init()
@@ -105,10 +105,10 @@ void PySideEasingCurveFunctor::init()
CustomFunctions<MAX_CUSTOM_FUNCTIONS-1>::init();
}
-QEasingCurve::EasingFunction PySideEasingCurveFunctor::createCustomFuntion(PyObject* parent, PyObject* pyFunc)
+QEasingCurve::EasingFunction PySideEasingCurveFunctor::createCustomFuntion(PyObject *parent, PyObject *pyFunc)
{
for(int i=0; i < MAX_CUSTOM_FUNCTIONS; i++) {
- CustomFunctionsData& data = CustomFunctionsData::m_list[i];
+ CustomFunctionsData &data = CustomFunctionsData::m_list[i];
if (data.m_obj == 0) {
data.m_obj = new PySideEasingCurveFunctor(i, parent, pyFunc);
return data.m_func;
@@ -128,8 +128,8 @@ PySideEasingCurveFunctor::~PySideEasingCurveFunctor()
qreal PySideEasingCurveFunctor::operator()(qreal progress)
{
Shiboken::GilState state;
- PyObject* args = Py_BuildValue("(f)", progress);
- PyObject* result = PyObject_CallObject(m_func, args);
+ PyObject *args = Py_BuildValue("(f)", progress);
+ PyObject *result = PyObject_CallObject(m_func, args);
qreal cppResult = 0.0;
if (result) {
Shiboken::Conversions::pythonToCppCopy(Shiboken::Conversions::PrimitiveTypeConverter<qreal>(), result, &cppResult);
@@ -139,18 +139,18 @@ qreal PySideEasingCurveFunctor::operator()(qreal progress)
return cppResult;
}
-PyObject* PySideEasingCurveFunctor::callable()
+PyObject *PySideEasingCurveFunctor::callable()
{
Py_INCREF(m_func);
return m_func;
}
-PyObject* PySideEasingCurveFunctor::callable(PyObject* parent)
+PyObject *PySideEasingCurveFunctor::callable(PyObject *parent)
{
return PyObject_GetAttrString(parent, __ECF_ATT_NAME__);
}
-PySideEasingCurveFunctor::PySideEasingCurveFunctor(int index, PyObject* parent, PyObject* pyFunc)
+PySideEasingCurveFunctor::PySideEasingCurveFunctor(int index, PyObject *parent, PyObject *pyFunc)
: m_parent(parent), m_func(pyFunc), m_index(index)
{
PyObject_SetAttrString(m_parent, __ECF_ATT_NAME__, m_func);
diff --git a/sources/pyside2/PySide2/QtCore/glue/qeasingcurve_glue.h b/sources/pyside2/PySide2/QtCore/glue/qeasingcurve_glue.h
index 358ea9eec..f6c80fa99 100644
--- a/sources/pyside2/PySide2/QtCore/glue/qeasingcurve_glue.h
+++ b/sources/pyside2/PySide2/QtCore/glue/qeasingcurve_glue.h
@@ -38,7 +38,7 @@
****************************************************************************/
#ifndef __QEASINGCURVE_GLUE__
-#define __QEASINGCURVE_GLUE__
+#define __QEASINGCURVE_GLUE__
#include <sbkpython.h>
#include <QEasingCurve>
@@ -47,20 +47,20 @@ class PySideEasingCurveFunctor
{
public:
static void init();
- static QEasingCurve::EasingFunction createCustomFuntion(PyObject* parent, PyObject* pyFunc);
+ static QEasingCurve::EasingFunction createCustomFuntion(PyObject *parent, PyObject *pyFunc);
qreal operator()(qreal progress);
- PyObject* callable(); //Return New reference
- static PyObject* callable(PyObject* parent); //Return New reference
+ PyObject *callable(); //Return New reference
+ static PyObject *callable(PyObject *parent); //Return New reference
~PySideEasingCurveFunctor();
private:
- PyObject* m_parent;
- PyObject* m_func;
+ PyObject *m_parent;
+ PyObject *m_func;
int m_index;
- PySideEasingCurveFunctor(int index, PyObject* parent, PyObject *pyFunc);
+ PySideEasingCurveFunctor(int index, PyObject *parent, PyObject *pyFunc);
};
#endif
diff --git a/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp b/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp
index 9d9ddc799..2386620ca 100644
--- a/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp
+++ b/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.cpp
@@ -54,19 +54,19 @@
#ifndef PYSIDE_MAX_QML_TYPES
// Maximum number of different Qt QML types the user can export to QML using
// qmlRegisterType. This limit exists because the QML engine instantiates objects
-// by calling a function with one argument (a void* pointer where the object should
+// by calling a function with one argument (a void *pointer where the object should
// be created), and thus does not allow us to choose which object to create. Thus
// we create a C++ factory function for each new registered type at compile time.
#define PYSIDE_MAX_QML_TYPES 50
#endif
// Forward declarations.
-static void propListMetaCall(PySideProperty* pp, PyObject* self, QMetaObject::Call call,
+static void propListMetaCall(PySideProperty *pp, PyObject *self, QMetaObject::Call call,
void **args);
// All registered python types and their creation functions.
-static PyObject* pyTypes[PYSIDE_MAX_QML_TYPES];
-static void (*createFuncs[PYSIDE_MAX_QML_TYPES])(void*);
+static PyObject *pyTypes[PYSIDE_MAX_QML_TYPES];
+static void (*createFuncs[PYSIDE_MAX_QML_TYPES])(void *);
// Mutex used to avoid race condition on PySide::nextQObjectMemoryAddr.
static QMutex nextQmlElementMutex;
@@ -74,12 +74,12 @@ static QMutex nextQmlElementMutex;
template<int N>
struct ElementFactoryBase
{
- static void createInto(void* memory)
+ static void createInto(void *memory)
{
QMutexLocker locker(&nextQmlElementMutex);
PySide::setNextQObjectMemoryAddr(memory);
Shiboken::GilState state;
- PyObject* obj = PyObject_CallObject(pyTypes[N], 0);
+ PyObject *obj = PyObject_CallObject(pyTypes[N], 0);
if (!obj || PyErr_Occurred())
PyErr_Print();
PySide::setNextQObjectMemoryAddr(0);
@@ -152,7 +152,7 @@ int PySide::qmlRegisterType(PyObject *pyObj, const char *uri, int versionMajor,
pyTypes[nextType] = pyObj;
// FIXME: Fix this to assign new type ids each time.
- type.typeId = qMetaTypeId<QObject*>();
+ type.typeId = qMetaTypeId<QObject *>();
type.listId = qMetaTypeId<QQmlListProperty<QObject> >();
type.attachedPropertiesFunction = QQmlPrivate::attachedPropertiesFunc<QObject>();
type.attachedPropertiesMetaObject = QQmlPrivate::attachedPropertiesMetaObject<QObject>();
@@ -194,22 +194,22 @@ extern "C"
// This is the user data we store in the property.
struct QmlListProperty
{
- PyTypeObject* type;
- PyObject* append;
- PyObject* at;
- PyObject* clear;
- PyObject* count;
+ PyTypeObject *type;
+ PyObject *append;
+ PyObject *at;
+ PyObject *clear;
+ PyObject *count;
};
-static int propListTpInit(PyObject* self, PyObject* args, PyObject* kwds)
+static int propListTpInit(PyObject *self, PyObject *args, PyObject *kwds)
{
static const char *kwlist[] = {"type", "append", "at", "clear", "count", 0};
- PySideProperty* pySelf = reinterpret_cast<PySideProperty*>(self);
- QmlListProperty* data = new QmlListProperty;
+ PySideProperty *pySelf = reinterpret_cast<PySideProperty *>(self);
+ QmlListProperty *data = new QmlListProperty;
memset(data, 0, sizeof(QmlListProperty));
if (!PyArg_ParseTupleAndKeywords(args, kwds,
- "OO|OOO:QtQml.ListProperty", (char**) kwlist,
+ "OO|OOO:QtQml.ListProperty", (char **) kwlist,
&data->type,
&data->append,
&data->at,
@@ -224,10 +224,10 @@ static int propListTpInit(PyObject* self, PyObject* args, PyObject* kwds)
return 1;
}
-void propListTpFree(void* self)
+void propListTpFree(void *self)
{
- PySideProperty* pySelf = reinterpret_cast<PySideProperty*>(self);
- delete reinterpret_cast<QmlListProperty*>(PySide::Property::userData(pySelf));
+ auto pySelf = reinterpret_cast<PySideProperty *>(self);
+ delete reinterpret_cast<QmlListProperty *>(PySide::Property::userData(pySelf));
// calls base type constructor
Py_TYPE(pySelf)->tp_base->tp_free(self);
}
@@ -266,10 +266,10 @@ void propListAppender(QQmlListProperty<QObject> *propList, QObject *item)
Shiboken::GilState state;
Shiboken::AutoDecRef args(PyTuple_New(2));
- PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX], propList->object));
- PyTuple_SET_ITEM(args, 1, Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX], item));
+ PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType *)SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX], propList->object));
+ PyTuple_SET_ITEM(args, 1, Shiboken::Conversions::pointerToPython((SbkObjectType *)SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX], item));
- QmlListProperty* data = reinterpret_cast<QmlListProperty*>(propList->data);
+ auto data = reinterpret_cast<QmlListProperty *>(propList->data);
Shiboken::AutoDecRef retVal(PyObject_CallObject(data->append, args));
if (PyErr_Occurred())
@@ -282,9 +282,9 @@ int propListCount(QQmlListProperty<QObject> *propList)
Shiboken::GilState state;
Shiboken::AutoDecRef args(PyTuple_New(1));
- PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX], propList->object));
+ PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType *)SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX], propList->object));
- QmlListProperty* data = reinterpret_cast<QmlListProperty*>(propList->data);
+ auto data = reinterpret_cast<QmlListProperty *>(propList->data);
Shiboken::AutoDecRef retVal(PyObject_CallObject(data->count, args));
// Check return type
@@ -303,17 +303,17 @@ QObject *propListAt(QQmlListProperty<QObject> *propList, int index)
Shiboken::GilState state;
Shiboken::AutoDecRef args(PyTuple_New(2));
- PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX], propList->object));
+ PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType *)SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX], propList->object));
PyTuple_SET_ITEM(args, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<int>(), &index));
- QmlListProperty* data = reinterpret_cast<QmlListProperty*>(propList->data);
+ auto data = reinterpret_cast<QmlListProperty *>(propList->data);
Shiboken::AutoDecRef retVal(PyObject_CallObject(data->at, args));
QObject *result = 0;
if (PyErr_Occurred())
PyErr_Print();
else if (PyType_IsSubtype(Py_TYPE(retVal), data->type))
- Shiboken::Conversions::pythonToCppPointer((SbkObjectType*)SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX], retVal, &result);
+ Shiboken::Conversions::pythonToCppPointer((SbkObjectType *)SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX], retVal, &result);
return result;
}
@@ -323,9 +323,9 @@ void propListClear(QQmlListProperty<QObject> * propList)
Shiboken::GilState state;
Shiboken::AutoDecRef args(PyTuple_New(1));
- PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX], propList->object));
+ PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType *)SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX], propList->object));
- QmlListProperty* data = reinterpret_cast<QmlListProperty*>(propList->data);
+ auto data = reinterpret_cast<QmlListProperty *>(propList->data);
Shiboken::AutoDecRef retVal(PyObject_CallObject(data->clear, args));
if (PyErr_Occurred())
@@ -333,18 +333,18 @@ void propListClear(QQmlListProperty<QObject> * propList)
}
// qt_metacall specialization for ListProperties
-static void propListMetaCall(PySideProperty* pp, PyObject* self, QMetaObject::Call call, void** args)
+static void propListMetaCall(PySideProperty *pp, PyObject *self, QMetaObject::Call call, void **args)
{
if (call != QMetaObject::ReadProperty)
return;
- QmlListProperty* data = reinterpret_cast<QmlListProperty*>(PySide::Property::userData(pp));
- QObject* qobj;
- Shiboken::Conversions::pythonToCppPointer((SbkObjectType*)SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX], self, &qobj);
+ auto data = reinterpret_cast<QmlListProperty *>(PySide::Property::userData(pp));
+ QObject *qobj;
+ Shiboken::Conversions::pythonToCppPointer((SbkObjectType *)SbkPySide2_QtCoreTypes[SBK_QOBJECT_IDX], self, &qobj);
QQmlListProperty<QObject> declProp(qobj, data, &propListAppender, &propListCount, &propListAt, &propListClear);
// Copy the data to the memory location requested by the meta call
- void* v = args[0];
+ void *v = args[0];
*reinterpret_cast<QQmlListProperty<QObject> *>(v) = declProp;
}
@@ -469,7 +469,7 @@ PyTypeObject *QtQml_VolatileBoolTypeF(void)
return type;
}
-void PySide::initQmlSupport(PyObject* module)
+void PySide::initQmlSupport(PyObject *module)
{
ElementFactory<PYSIDE_MAX_QML_TYPES - 1>::init();
diff --git a/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.h b/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.h
index 0ef6539a5..e94ea043f 100644
--- a/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.h
+++ b/sources/pyside2/PySide2/QtQml/pysideqmlregistertype.h
@@ -47,7 +47,7 @@ struct SbkObjectType;
namespace PySide
{
-extern void* nextQmlElementMemoryAddr;
+extern void *nextQmlElementMemoryAddr;
/**
* Init the QML support doing things like registering QtQml.ListProperty and create the necessary stuff for
@@ -55,7 +55,7 @@ extern void* nextQmlElementMemoryAddr;
*
* \param module QtQml python module
*/
-void initQmlSupport(PyObject* module);
+void initQmlSupport(PyObject *module);
/**
* PySide implementation of qmlRegisterType<T> function.
diff --git a/sources/pyside2/PySide2/QtQuick/pysidequickregistertype.cpp b/sources/pyside2/PySide2/QtQuick/pysidequickregistertype.cpp
index e50b1dfc7..7278edff3 100644
--- a/sources/pyside2/PySide2/QtQuick/pysidequickregistertype.cpp
+++ b/sources/pyside2/PySide2/QtQuick/pysidequickregistertype.cpp
@@ -62,7 +62,7 @@
// All registered python types and their creation functions.
static PyObject *pyTypes[PYSIDE_MAX_QUICK_TYPES];
-static void (*createFuncs[PYSIDE_MAX_QUICK_TYPES])(void*);
+static void (*createFuncs[PYSIDE_MAX_QUICK_TYPES])(void *);
// Mutex used to avoid race condition on PySide::nextQObjectMemoryAddr.
static QMutex nextQmlElementMutex;
@@ -153,8 +153,8 @@ void registerTypeIfInheritsFromClass(
::Construct,
sizeof(QQmlListProperty<WrapperClass>),
static_cast< ::QFlags<QMetaType::TypeFlag> >(
- QtPrivate::QMetaTypeTypeFlags<QQmlListProperty<WrapperClass> >::Flags),
- static_cast<QMetaObject*>(0));
+ QtPrivate::QMetaTypeTypeFlags<QQmlListProperty<WrapperClass> >::Flags),
+ nullptr);
if (lstType == -1) {
PyErr_Format(PyExc_TypeError, "Meta type registration of \"%s\" for QML usage failed.",
typeListName.constData());
diff --git a/sources/pyside2/PySide2/QtScript/qscript_value_iterator_glue.cpp b/sources/pyside2/PySide2/QtScript/qscript_value_iterator_glue.cpp
index fd9cd84a3..11dfd19b0 100644
--- a/sources/pyside2/PySide2/QtScript/qscript_value_iterator_glue.cpp
+++ b/sources/pyside2/PySide2/QtScript/qscript_value_iterator_glue.cpp
@@ -1,3 +1,3 @@
%PYARG_0 = Shiboken::Object::newObject(
- reinterpret_cast<SbkObjectType*>(Shiboken::SbkType< ::QScriptValueIterator >()),
+ reinterpret_cast<SbkObjectType *>(Shiboken::SbkType< ::QScriptValueIterator >()),
new QScriptValueIterator(*%CPPSELF), true, true);
diff --git a/sources/pyside2/PySide2/QtUiTools/glue/plugins.h b/sources/pyside2/PySide2/QtUiTools/glue/plugins.h
index d1b250d50..9bfcec6ea 100644
--- a/sources/pyside2/PySide2/QtUiTools/glue/plugins.h
+++ b/sources/pyside2/PySide2/QtUiTools/glue/plugins.h
@@ -43,13 +43,14 @@
#include <QPluginLoader>
#include "customwidgets.h"
-inline void registerCustomWidget(PyObject* obj)
+inline void registerCustomWidget(PyObject *obj)
{
- static PyCustomWidgets* plugin = 0;
+ static PyCustomWidgets *plugin = nullptr;
if (plugin == 0) {
- foreach(QObject* o, QPluginLoader::staticInstances()) {
- plugin = qobject_cast<PyCustomWidgets*>(o);
+ const auto &instances = QPluginLoader::staticInstances();
+ for (QObject *o : instances) {
+ plugin = qobject_cast<PyCustomWidgets *>(o);
if (plugin)
break;
}
diff --git a/sources/pyside2/PySide2/glue/qtcore.cpp b/sources/pyside2/PySide2/glue/qtcore.cpp
index 9db4e2e82..cb5cb4e68 100644
--- a/sources/pyside2/PySide2/glue/qtcore.cpp
+++ b/sources/pyside2/PySide2/glue/qtcore.cpp
@@ -60,8 +60,8 @@ bool py2kStrCheck(PyObject *obj)
static const char *QVariant_resolveMetaType(PyTypeObject *type, int *typeId)
{
if (PyObject_TypeCheck(type, SbkObjectType_TypeF())) {
- SbkObjectType* sbkType = (SbkObjectType*)type;
- const char* typeName = Shiboken::ObjectType::getOriginalName(sbkType);
+ auto sbkType = reinterpret_cast<SbkObjectType *>(type);
+ const char *typeName = Shiboken::ObjectType::getOriginalName(sbkType);
if (!typeName)
return nullptr;
const bool valueType = '*' != typeName[qstrlen(typeName) - 1];
@@ -105,7 +105,7 @@ static QVariant QVariant_convertToValueList(PyObject *list)
Shiboken::AutoDecRef element(PySequence_GetItem(list, 0));
int typeId;
- const char *typeName = QVariant_resolveMetaType(element.cast<PyTypeObject*>(), &typeId);
+ const char *typeName = QVariant_resolveMetaType(element.cast<PyTypeObject *>(), &typeId);
if (typeName) {
QByteArray listTypeName("QList<");
listTypeName += typeName;
@@ -220,7 +220,7 @@ double _abs = qAbs(%1);
// @snippet qt-postroutine
namespace PySide {
-static QStack<PyObject*> globalPostRoutineFunctions;
+static QStack<PyObject *> globalPostRoutineFunctions;
void globalPostRoutineCallback()
{
Shiboken::GilState state;
@@ -260,7 +260,7 @@ PyModule_AddStringConstant(module, "__version__", qVersion());
// @snippet qt-version
// @snippet qobject-connect
-static bool isDecorator(PyObject* method, PyObject* self)
+static bool isDecorator(PyObject *method, PyObject *self)
{
Shiboken::AutoDecRef methodName(PyObject_GetAttrString(method, "__name__"));
if (!PyObject_HasAttr(self, methodName))
@@ -269,18 +269,18 @@ static bool isDecorator(PyObject* method, PyObject* self)
return PyMethod_GET_FUNCTION(otherMethod.object()) != PyMethod_GET_FUNCTION(method);
}
-static bool getReceiver(QObject *source, const char* signal, PyObject* callback, QObject** receiver, PyObject** self, QByteArray* callbackSig)
+static bool getReceiver(QObject *source, const char *signal, PyObject *callback, QObject **receiver, PyObject **self, QByteArray *callbackSig)
{
bool forceGlobalReceiver = false;
if (PyMethod_Check(callback)) {
*self = PyMethod_GET_SELF(callback);
- if (%CHECKTYPE[QObject*](*self))
- *receiver = %CONVERTTOCPP[QObject*](*self);
+ if (%CHECKTYPE[QObject *](*self))
+ *receiver = %CONVERTTOCPP[QObject *](*self);
forceGlobalReceiver = isDecorator(callback, *self);
} else if (PyCFunction_Check(callback)) {
*self = PyCFunction_GET_SELF(callback);
- if (*self && %CHECKTYPE[QObject*](*self))
- *receiver = %CONVERTTOCPP[QObject*](*self);
+ if (*self && %CHECKTYPE[QObject *](*self))
+ *receiver = %CONVERTTOCPP[QObject *](*self);
} else if (PyCallable_Check(callback)) {
// Ok, just a callable object
*receiver = nullptr;
@@ -292,14 +292,14 @@ static bool getReceiver(QObject *source, const char* signal, PyObject* callback,
// Check if this callback is a overwrite of a non-virtual Qt slot.
if (!usingGlobalReceiver && receiver && self) {
*callbackSig = PySide::Signal::getCallbackSignature(signal, *receiver, callback, usingGlobalReceiver).toLatin1();
- const QMetaObject* metaObject = (*receiver)->metaObject();
+ const QMetaObject *metaObject = (*receiver)->metaObject();
int slotIndex = metaObject->indexOfSlot(callbackSig->constData());
if (slotIndex != -1 && slotIndex < metaObject->methodOffset() && PyMethod_Check(callback))
usingGlobalReceiver = true;
}
if (usingGlobalReceiver) {
- PySide::SignalManager& signalManager = PySide::SignalManager::instance();
+ PySide::SignalManager &signalManager = PySide::SignalManager::instance();
*receiver = signalManager.globalReceiver(source, callback);
*callbackSig = PySide::Signal::getCallbackSignature(signal, *receiver, callback, usingGlobalReceiver).toLatin1();
}
@@ -307,7 +307,7 @@ static bool getReceiver(QObject *source, const char* signal, PyObject* callback,
return usingGlobalReceiver;
}
-static bool qobjectConnect(QObject* source, const char* signal, QObject* receiver, const char* slot, Qt::ConnectionType type)
+static bool qobjectConnect(QObject *source, const char *signal, QObject *receiver, const char *slot, Qt::ConnectionType type)
{
if (!signal || !slot)
return false;
@@ -329,12 +329,12 @@ static bool qobjectConnect(QObject* source, const char* signal, QObject* receive
return connection;
}
-static bool qobjectConnect(QObject* source, QMetaMethod signal, QObject* receiver, QMetaMethod slot, Qt::ConnectionType type)
+static bool qobjectConnect(QObject *source, QMetaMethod signal, QObject *receiver, QMetaMethod slot, Qt::ConnectionType type)
{
return qobjectConnect(source, signal.methodSignature(), receiver, slot.methodSignature(), type);
}
-static bool qobjectConnectCallback(QObject* source, const char* signal, PyObject* callback, Qt::ConnectionType type)
+static bool qobjectConnectCallback(QObject *source, const char *signal, PyObject *callback, Qt::ConnectionType type)
{
if (!signal || !PySide::Signal::checkQtSignal(signal))
return false;
@@ -344,23 +344,23 @@ static bool qobjectConnectCallback(QObject* source, const char* signal, PyObject
if (signalIndex == -1)
return false;
- PySide::SignalManager& signalManager = PySide::SignalManager::instance();
+ PySide::SignalManager &signalManager = PySide::SignalManager::instance();
// Extract receiver from callback
- QObject* receiver = nullptr;
- PyObject* self = nullptr;
+ QObject *receiver = nullptr;
+ PyObject *self = nullptr;
QByteArray callbackSig;
bool usingGlobalReceiver = getReceiver(source, signal, callback, &receiver, &self, &callbackSig);
if (receiver == nullptr && self == nullptr)
return false;
- const QMetaObject* metaObject = receiver->metaObject();
- const char* slot = callbackSig.constData();
+ const QMetaObject *metaObject = receiver->metaObject();
+ const char *slot = callbackSig.constData();
int slotIndex = metaObject->indexOfSlot(slot);
QMetaMethod signalMethod = metaObject->method(signalIndex);
if (slotIndex == -1) {
- if (!usingGlobalReceiver && self && !Shiboken::Object::hasCppWrapper((SbkObject*)self)) {
+ if (!usingGlobalReceiver && self && !Shiboken::Object::hasCppWrapper(reinterpret_cast<SbkObject *>(self))) {
qWarning("You can't add dynamic slots on an object originated from C++.");
if (usingGlobalReceiver)
signalManager.releaseGlobalReceiver(source, receiver);
@@ -388,11 +388,11 @@ static bool qobjectConnectCallback(QObject* source, const char* signal, PyObject
if (usingGlobalReceiver)
signalManager.notifyGlobalReceiver(receiver);
#ifndef AVOID_PROTECTED_HACK
- source->connectNotify(signalMethod); //Qt5: QMetaMethod instead of char*
+ source->connectNotify(signalMethod); //Qt5: QMetaMethod instead of char *
#else
- // Need to cast to QObjectWrapper* and call the public version of
+ // Need to cast to QObjectWrapper * and call the public version of
// connectNotify when avoiding the protected hack.
- reinterpret_cast<QObjectWrapper*>(source)->connectNotify(signalMethod); //Qt5: QMetaMethod instead of char*
+ reinterpret_cast<QObjectWrapper *>(source)->connectNotify(signalMethod); //Qt5: QMetaMethod instead of char *
#endif
return connection;
@@ -405,23 +405,23 @@ static bool qobjectConnectCallback(QObject* source, const char* signal, PyObject
}
-static bool qobjectDisconnectCallback(QObject* source, const char* signal, PyObject* callback)
+static bool qobjectDisconnectCallback(QObject *source, const char *signal, PyObject *callback)
{
if (!PySide::Signal::checkQtSignal(signal))
return false;
- PySide::SignalManager& signalManager = PySide::SignalManager::instance();
+ PySide::SignalManager &signalManager = PySide::SignalManager::instance();
// Extract receiver from callback
- QObject* receiver = nullptr;
- PyObject* self = nullptr;
+ QObject *receiver = nullptr;
+ PyObject *self = nullptr;
QByteArray callbackSig;
QMetaMethod slotMethod;
bool usingGlobalReceiver = getReceiver(nullptr, signal, callback, &receiver, &self, &callbackSig);
if (receiver == nullptr && self == nullptr)
return false;
- const QMetaObject* metaObject = receiver->metaObject();
+ const QMetaObject *metaObject = receiver->metaObject();
int signalIndex = source->metaObject()->indexOfSignal(++signal);
int slotIndex = -1;
@@ -438,11 +438,11 @@ static bool qobjectDisconnectCallback(QObject* source, const char* signal, PyObj
signalManager.releaseGlobalReceiver(source, receiver);
#ifndef AVOID_PROTECTED_HACK
- source->disconnectNotify(slotMethod); //Qt5: QMetaMethod instead of char*
+ source->disconnectNotify(slotMethod); //Qt5: QMetaMethod instead of char *
#else
- // Need to cast to QObjectWrapper* and call the public version of
+ // Need to cast to QObjectWrapper * and call the public version of
// connectNotify when avoiding the protected hack.
- reinterpret_cast<QObjectWrapper*>(source)->disconnectNotify(slotMethod); //Qt5: QMetaMethod instead of char*
+ reinterpret_cast<QObjectWrapper *>(source)->disconnectNotify(slotMethod); //Qt5: QMetaMethod instead of char *
#endif
return true;
}
@@ -706,10 +706,10 @@ qRegisterMetaType<QVector<int> >("QVector<int>");
// @snippet qobject-metaobject
// @snippet qobject-findchild-1
-static QObject* _findChildHelper(const QObject* parent, const QString& name, PyTypeObject* desiredType)
+static QObject *_findChildHelper(const QObject *parent, const QString &name, PyTypeObject *desiredType)
{
for (auto *child : parent->children()) {
- Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QObject*](child));
+ Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QObject *](child));
if (PyType_IsSubtype(Py_TYPE(pyChild), desiredType)
&& (name.isNull() || name == child->objectName())) {
return child;
@@ -724,21 +724,21 @@ static QObject* _findChildHelper(const QObject* parent, const QString& name, PyT
return nullptr;
}
-static inline bool _findChildrenComparator(const QObject*& child, const QRegExp& name)
+static inline bool _findChildrenComparator(const QObject *&child, const QRegExp &name)
{
return name.indexIn(child->objectName()) != -1;
}
-static inline bool _findChildrenComparator(const QObject*& child, const QString& name)
+static inline bool _findChildrenComparator(const QObject *&child, const QString &name)
{
return name.isNull() || name == child->objectName();
}
template<typename T>
-static void _findChildrenHelper(const QObject* parent, const T& name, PyTypeObject* desiredType, PyObject* result)
+static void _findChildrenHelper(const QObject *parent, const T& name, PyTypeObject *desiredType, PyObject *result)
{
for (const auto *child : parent->children()) {
- Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QObject*](child));
+ Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QObject *](child));
if (PyType_IsSubtype(Py_TYPE(pyChild), desiredType) && _findChildrenComparator(child, name))
PyList_Append(result, pyChild);
_findChildrenHelper(child, name, desiredType, result);
@@ -747,18 +747,18 @@ static void _findChildrenHelper(const QObject* parent, const T& name, PyTypeObje
// @snippet qobject-findchild-1
// @snippet qobject-findchild-2
-QObject *child = _findChildHelper(%CPPSELF, %2, (PyTypeObject*)%PYARG_1);
-%PYARG_0 = %CONVERTTOPYTHON[QObject*](child);
+QObject *child = _findChildHelper(%CPPSELF, %2, reinterpret_cast<PyTypeObject *>(%PYARG_1));
+%PYARG_0 = %CONVERTTOPYTHON[QObject *](child);
// @snippet qobject-findchild-2
// @snippet qobject-findchildren-1
%PYARG_0 = PyList_New(0);
-_findChildrenHelper(%CPPSELF, %2, (PyTypeObject*)%PYARG_1, %PYARG_0);
+_findChildrenHelper(%CPPSELF, %2, reinterpret_cast<PyTypeObject *>(%PYARG_1), %PYARG_0);
// @snippet qobject-findchildren-1
// @snippet qobject-findchildren-2
%PYARG_0 = PyList_New(0);
-_findChildrenHelper(%CPPSELF, %2, (PyTypeObject*)%PYARG_1, %PYARG_0);
+_findChildrenHelper(%CPPSELF, %2, reinterpret_cast<PyTypeObject *>(%PYARG_1), %PYARG_0);
// @snippet qobject-findchildren-2
// @snippet qobject-tr
@@ -942,8 +942,7 @@ if (PyIndex_Check(_key)) {
int overflow;
long ival = PyLong_AsLongAndOverflow(item, &overflow);
// Not suppose to bigger than 255 because only bytes, bytearray, QByteArray were accept
- const char *el = reinterpret_cast<const char*>(&ival);
- temp = QByteArray(el);
+ temp = QByteArray(reinterpret_cast<const char *>(&ival));
} else {
temp = %CONVERTTOCPP[QByteArray](item);
}
@@ -969,18 +968,19 @@ extern "C" {
// QByteArray buffer protocol functions
// see: http://www.python.org/dev/peps/pep-3118/
-static int SbkQByteArray_getbufferproc(PyObject* obj, Py_buffer *view, int flags)
+static int SbkQByteArray_getbufferproc(PyObject *obj, Py_buffer *view, int flags)
{
if (!view || !Shiboken::Object::isValid(obj))
return -1;
- QByteArray* cppSelf = %CONVERTTOCPP[QByteArray*](obj);
+ QByteArray * cppSelf = %CONVERTTOCPP[QByteArray *](obj);
+ //XXX /|\ omitting this space crashes shiboken!
view->obj = obj;
- view->buf = reinterpret_cast<void*>(cppSelf->data());
+ view->buf = reinterpret_cast<void *>(cppSelf->data());
view->len = cppSelf->size();
view->readonly = 0;
view->itemsize = 1;
- view->format = const_cast<char*>("c");
+ view->format = const_cast<char *>("c");
view->ndim = 1;
view->shape = NULL;
view->strides = &view->itemsize;
@@ -992,20 +992,21 @@ static int SbkQByteArray_getbufferproc(PyObject* obj, Py_buffer *view, int flags
}
#if PY_VERSION_HEX < 0x03000000
-static Py_ssize_t SbkQByteArray_segcountproc(PyObject* self, Py_ssize_t* lenp)
+static Py_ssize_t SbkQByteArray_segcountproc(PyObject *self, Py_ssize_t *lenp)
{
if (lenp)
*lenp = Py_TYPE(self)->tp_as_sequence->sq_length(self);
return 1;
}
-static Py_ssize_t SbkQByteArray_readbufferproc(PyObject* self, Py_ssize_t segment, void** ptrptr)
+static Py_ssize_t SbkQByteArray_readbufferproc(PyObject *self, Py_ssize_t segment, void **ptrptr)
{
if (segment || !Shiboken::Object::isValid(self))
return -1;
- QByteArray* cppSelf = %CONVERTTOCPP[QByteArray*](self);
- *ptrptr = reinterpret_cast<void*>(cppSelf->data());
+ QByteArray * cppSelf = %CONVERTTOCPP[QByteArray *](self);
+ //XXX /|\ omitting this space crashes shiboken!
+ *ptrptr = reinterpret_cast<void *>(cppSelf->data());
return cppSelf->size();
}
@@ -1191,7 +1192,7 @@ return !result ? -1 : 0;
// @snippet qbytearray-setitem
// @snippet qfiledevice-unmap
-uchar *ptr = reinterpret_cast<uchar*>(Shiboken::Buffer::getPointer(%PYARG_1));
+uchar *ptr = reinterpret_cast<uchar *>(Shiboken::Buffer::getPointer(%PYARG_1));
%RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(ptr);
%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
// @snippet qfiledevice-unmap
@@ -1229,8 +1230,8 @@ if (socket != nullptr) {
// @snippet qtranslator-load
Py_ssize_t size;
-uchar *ptr = reinterpret_cast<uchar*>(Shiboken::Buffer::getPointer(%PYARG_1, &size));
-%RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(const_cast<const uchar*>(ptr), size);
+uchar *ptr = reinterpret_cast<uchar *>(Shiboken::Buffer::getPointer(%PYARG_1, &size));
+%RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(const_cast<const uchar *>(ptr), size);
%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
// @snippet qtranslator-load
@@ -1241,17 +1242,18 @@ Shiboken::AutoDecRef emptyTuple(PyTuple_New(0));
PyObject *pyTimer = reinterpret_cast<PyTypeObject *>(Shiboken::SbkType<QTimer>())->tp_new(Shiboken::SbkType<QTimer>(), emptyTuple, 0);
reinterpret_cast<PyTypeObject *>(Shiboken::SbkType<QTimer>())->tp_init(pyTimer, emptyTuple, 0);
-QTimer* timer = %CONVERTTOCPP[QTimer*](pyTimer);
+QTimer * timer = %CONVERTTOCPP[QTimer *](pyTimer);
+//XXX /|\ omitting this space crashes shiboken!
Shiboken::AutoDecRef result(
PyObject_CallMethod(pyTimer,
- const_cast<char*>("connect"),
- const_cast<char*>("OsOs"),
+ const_cast<char *>("connect"),
+ const_cast<char *>("OsOs"),
pyTimer,
SIGNAL(timeout()),
%PYARG_2,
%3)
);
-Shiboken::Object::releaseOwnership((SbkObject*)pyTimer);
+Shiboken::Object::releaseOwnership((SbkObject *)pyTimer);
Py_XDECREF(pyTimer);
timer->setSingleShot(true);
timer->connect(timer, SIGNAL(timeout()), timer, SLOT(deleteLater()));
@@ -1263,16 +1265,16 @@ timer->start(%1);
Shiboken::AutoDecRef emptyTuple(PyTuple_New(0));
PyObject *pyTimer = reinterpret_cast<PyTypeObject *>(Shiboken::SbkType<QTimer>())->tp_new(Shiboken::SbkType<QTimer>(), emptyTuple, 0);
reinterpret_cast<PyTypeObject *>(Shiboken::SbkType<QTimer>())->tp_init(pyTimer, emptyTuple, 0);
-QTimer* timer = %CONVERTTOCPP[QTimer*](pyTimer);
+QTimer * timer = %CONVERTTOCPP[QTimer *](pyTimer);
timer->setSingleShot(true);
if (PyObject_TypeCheck(%2, PySideSignalInstanceTypeF())) {
- PySideSignalInstance *signalInstance = reinterpret_cast<PySideSignalInstance*>(%2);
+ PySideSignalInstance *signalInstance = reinterpret_cast<PySideSignalInstance *>(%2);
Shiboken::AutoDecRef signalSignature(Shiboken::String::fromFormat("2%s", PySide::Signal::getSignature(signalInstance)));
Shiboken::AutoDecRef result(
PyObject_CallMethod(pyTimer,
- const_cast<char*>("connect"),
- const_cast<char*>("OsOO"),
+ const_cast<char *>("connect"),
+ const_cast<char *>("OsOO"),
pyTimer,
SIGNAL(timeout()),
PySide::Signal::getObject(signalInstance),
@@ -1281,8 +1283,8 @@ if (PyObject_TypeCheck(%2, PySideSignalInstanceTypeF())) {
} else {
Shiboken::AutoDecRef result(
PyObject_CallMethod(pyTimer,
- const_cast<char*>("connect"),
- const_cast<char*>("OsO"),
+ const_cast<char *>("connect"),
+ const_cast<char *>("OsO"),
pyTimer,
SIGNAL(timeout()),
%PYARG_2)
@@ -1290,7 +1292,7 @@ if (PyObject_TypeCheck(%2, PySideSignalInstanceTypeF())) {
}
timer->connect(timer, SIGNAL(timeout()), timer, SLOT(deleteLater()), Qt::DirectConnection);
-Shiboken::Object::releaseOwnership((SbkObject*)pyTimer);
+Shiboken::Object::releaseOwnership(reinterpret_cast<SbkObject *>(pyTimer));
Py_XDECREF(pyTimer);
timer->start(%1);
// @snippet qtimer-singleshot-2
@@ -1322,7 +1324,7 @@ static void QCoreApplicationConstructor(PyObject *self, PyObject *pyargv, QCoreA
PyObject *stringlist = PyTuple_GET_ITEM(pyargv, 0);
if (Shiboken::listToArgcArgv(stringlist, &argc, &argv, "PySideApp")) {
*cptr = new QCoreApplicationWrapper(argc, argv);
- Shiboken::Object::releaseOwnership(reinterpret_cast<SbkObject*>(self));
+ Shiboken::Object::releaseOwnership(reinterpret_cast<SbkObject *>(self));
PySide::registerCleanupFunction(&PySide::destroyQCoreApplication);
}
}
@@ -1342,10 +1344,10 @@ if (!PyTuple_SetItem(empty, 0, PyList_New(0))) {
// @snippet qcoreapplication-instance
PyObject *pyApp = Py_None;
if (qApp) {
- pyApp = reinterpret_cast<PyObject*>(
+ pyApp = reinterpret_cast<PyObject *>(
Shiboken::BindingManager::instance().retrieveWrapper(qApp));
if (!pyApp)
- pyApp = %CONVERTTOPYTHON[QCoreApplication*](qApp);
+ pyApp = %CONVERTTOPYTHON[QCoreApplication *](qApp);
// this will keep app live after python exit (extra ref)
}
// PYSIDE-571: make sure that we return the singleton "None"
@@ -1379,7 +1381,7 @@ Shiboken::Object::releaseOwnership(%PYARG_0);
// @snippet qanimationgroup-clear
for (int counter = 0, count = %CPPSELF.animationCount(); counter < count; ++counter ) {
QAbstractAnimation *animation = %CPPSELF.animationAt(counter);
- PyObject *obj = %CONVERTTOPYTHON[QAbstractAnimation*](animation);
+ PyObject *obj = %CONVERTTOPYTHON[QAbstractAnimation *](animation);
Shiboken::Object::setParent(nullptr, obj);
Py_DECREF(obj);
}
@@ -1403,11 +1405,12 @@ if (func)
// @snippet qsignaltransition
if (PyObject_TypeCheck(%1, PySideSignalInstanceTypeF())) {
- PyObject *dataSource = PySide::Signal::getObject((PySideSignalInstance*)%PYARG_1);
+ PyObject *dataSource = PySide::Signal::getObject((PySideSignalInstance *)%PYARG_1);
Shiboken::AutoDecRef obType(PyObject_Type(dataSource));
- QObject* sender = %CONVERTTOCPP[QObject*](dataSource);
+ QObject * sender = %CONVERTTOCPP[QObject *](dataSource);
+ //XXX /|\ omitting this space crashes shiboken!
if (sender) {
- const char*dataSignature = PySide::Signal::getSignature((PySideSignalInstance*)%PYARG_1);
+ const char *dataSignature = PySide::Signal::getSignature((PySideSignalInstance *)%PYARG_1);
QByteArray signature(dataSignature); // Append SIGNAL flag (2)
signature.prepend('2');
%0 = new QSignalTransitionWrapper(sender, signature, %2);
@@ -1419,7 +1422,7 @@ if (PyObject_TypeCheck(%1, PySideSignalInstanceTypeF())) {
QString signalName(%2);
if (PySide::SignalManager::registerMetaMethod(%1, signalName.mid(1).toLatin1().data(), QMetaMethod::Signal)) {
QSignalTransition *%0 = %CPPSELF->addTransition(%1, %2, %3);
- %PYARG_0 = %CONVERTTOPYTHON[QSignalTransition*](%0);
+ %PYARG_0 = %CONVERTTOPYTHON[QSignalTransition *](%0);
} else {
Py_INCREF(Py_None);
%PYARG_0 = Py_None;
@@ -1433,16 +1436,17 @@ if (PySide::SignalManager::registerMetaMethod(%1, signalName.mid(1).toLatin1().d
// http://bugs.openbossa.org/show_bug.cgi?id=362
if (!PyObject_TypeCheck(%1, PySideSignalInstanceTypeF()))
goto Sbk_%TYPEFunc_%FUNCTION_NAME_TypeError;
-PySideSignalInstance *signalInstance = reinterpret_cast<PySideSignalInstance*>(%1);
-QObject* sender = %CONVERTTOCPP[QObject*](PySide::Signal::getObject(signalInstance));
+PySideSignalInstance *signalInstance = reinterpret_cast<PySideSignalInstance *>(%1);
+QObject * sender = %CONVERTTOCPP[QObject *](PySide::Signal::getObject(signalInstance));
+//XXX /|\ omitting this space crashes shiboken!
QSignalTransition *%0 = %CPPSELF->%FUNCTION_NAME(sender, PySide::Signal::getSignature(signalInstance),%2);
-%PYARG_0 = %CONVERTTOPYTHON[QSignalTransition*](%0);
+%PYARG_0 = %CONVERTTOPYTHON[QSignalTransition *](%0);
// @snippet qstate-addtransition-2
// @snippet qstatemachine-configuration
%PYARG_0 = PySet_New(0);
for (auto *abs_state : %CPPSELF.configuration()) {
- Shiboken::AutoDecRef obj(%CONVERTTOPYTHON[QAbstractState*](abs_state));
+ Shiboken::AutoDecRef obj(%CONVERTTOPYTHON[QAbstractState *](abs_state));
Shiboken::Object::setParent(self, obj);
PySet_Add(%PYARG_0, obj);
}
@@ -1451,7 +1455,7 @@ for (auto *abs_state : %CPPSELF.configuration()) {
// @snippet qstatemachine-defaultanimations
%PYARG_0 = PyList_New(0);
for (auto *abs_anim : %CPPSELF.defaultAnimations()) {
- Shiboken::AutoDecRef obj(%CONVERTTOPYTHON[QAbstractAnimation*](abs_anim));
+ Shiboken::AutoDecRef obj(%CONVERTTOPYTHON[QAbstractAnimation *](abs_anim));
Shiboken::Object::setParent(self, obj);
PyList_Append(%PYARG_0, obj);
}
@@ -1482,16 +1486,16 @@ QT_END_NAMESPACE
// @snippet qt-registerresourcedata
// @snippet qt-qregisterresourcedata
-%RETURN_TYPE %0 = %FUNCTION_NAME(%1, reinterpret_cast<uchar*>(PyBytes_AS_STRING(%PYARG_2)),
- reinterpret_cast<uchar*>(PyBytes_AS_STRING(%PYARG_3)),
- reinterpret_cast<uchar*>(PyBytes_AS_STRING(%PYARG_4)));
+%RETURN_TYPE %0 = %FUNCTION_NAME(%1, reinterpret_cast<uchar *>(PyBytes_AS_STRING(%PYARG_2)),
+ reinterpret_cast<uchar *>(PyBytes_AS_STRING(%PYARG_3)),
+ reinterpret_cast<uchar *>(PyBytes_AS_STRING(%PYARG_4)));
%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
// @snippet qt-qregisterresourcedata
// @snippet qt-qunregisterresourcedata
-%RETURN_TYPE %0 = %FUNCTION_NAME(%1, reinterpret_cast<uchar*>(PyBytes_AS_STRING(%PYARG_2)),
- reinterpret_cast<uchar*>(PyBytes_AS_STRING(%PYARG_3)),
- reinterpret_cast<uchar*>(PyBytes_AS_STRING(%PYARG_4)));
+%RETURN_TYPE %0 = %FUNCTION_NAME(%1, reinterpret_cast<uchar *>(PyBytes_AS_STRING(%PYARG_2)),
+ reinterpret_cast<uchar *>(PyBytes_AS_STRING(%PYARG_3)),
+ reinterpret_cast<uchar *>(PyBytes_AS_STRING(%PYARG_4)));
%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
// @snippet qt-qunregisterresourcedata
@@ -1502,8 +1506,8 @@ QT_END_NAMESPACE
// @snippet use-stream-for-format-security
// @snippet qresource-registerResource
- auto ptr = reinterpret_cast<uchar*>(Shiboken::Buffer::getPointer(%PYARG_1));
- %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(const_cast<const uchar*>(ptr), %2);
+ auto ptr = reinterpret_cast<uchar *>(Shiboken::Buffer::getPointer(%PYARG_1));
+ %RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(const_cast<const uchar *>(ptr), %2);
%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
// @snippet qresource-registerResource
@@ -1529,11 +1533,11 @@ QString &res = *%0;
// @snippet return-readData
%RETURN_TYPE %0 = 0;
if (PyBytes_Check(%PYARG_0)) {
- %0 = PyBytes_GET_SIZE((PyObject*)%PYARG_0);
- memcpy(%1, PyBytes_AS_STRING((PyObject*)%PYARG_0), %0);
+ %0 = PyBytes_GET_SIZE((PyObject *)%PYARG_0);
+ memcpy(%1, PyBytes_AS_STRING((PyObject *)%PYARG_0), %0);
} else if (Shiboken::String::check(%PYARG_0)) {
- %0 = Shiboken::String::len((PyObject*)%PYARG_0);
- memcpy(%1, Shiboken::String::toCString((PyObject*)%PYARG_0), %0);
+ %0 = Shiboken::String::len((PyObject *)%PYARG_0);
+ memcpy(%1, Shiboken::String::toCString((PyObject *)%PYARG_0), %0);
}
// @snippet return-readData
@@ -1545,7 +1549,7 @@ QByteArray ba(1 + int(%2), char(0));
// @snippet qt-module-shutdown
{ // Avoid name clash
- Shiboken::AutoDecRef regFunc((PyObject*)NULL);
+ Shiboken::AutoDecRef regFunc(static_cast<PyObject *>(nullptr));
Shiboken::AutoDecRef atexit(Shiboken::Module::import("atexit"));
if (atexit.isNull()) {
qWarning("Module atexit not found for registering __moduleShutdown");
@@ -1586,12 +1590,12 @@ QByteArray ba(1 + int(%2), char(0));
// @snippet conversion-pyunicode
#ifndef Py_LIMITED_API
-Py_UNICODE* unicode = PyUnicode_AS_UNICODE(%in);
+Py_UNICODE *unicode = PyUnicode_AS_UNICODE(%in);
# if defined(Py_UNICODE_WIDE)
// cast as Py_UNICODE can be a different type
-%out = QString::fromUcs4((const uint*)unicode);
+%out = QString::fromUcs4((const uint *)unicode);
# else
-%out = QString::fromUtf16((const ushort*)unicode, PyUnicode_GET_SIZE(%in));
+%out = QString::fromUtf16((const ushort *)unicode, PyUnicode_GET_SIZE(%in));
# endif
#else
wchar_t *temp = PyUnicode_AsWideCharString(%in, NULL);
@@ -1602,7 +1606,8 @@ PyMem_Free(temp);
// @snippet conversion-pystring
#ifndef IS_PY3K
-const char* str = %CONVERTTOCPP[const char*](%in);
+const char * str = %CONVERTTOCPP[const char *](%in);
+//XXX /|\ omitting this space crashes shiboken!
%out = %OUTTYPE(str);
#endif
// @snippet conversion-pystring
@@ -1650,7 +1655,7 @@ if (!typeCode || !typeName) {
%out = QVariant::fromValue(PySide::PyObjectWrapper(%in));
}
else {
- QVariant var(typeCode, (void*)0);
+ QVariant var(typeCode, nullptr);
Shiboken::Conversions::SpecificConverter converter(typeName);
converter.toCpp(pyIn, var.data());
%out = var;
@@ -1680,12 +1685,12 @@ QVariant ret = QVariant_convertToVariantList(%in);
const char *typeName;
if (Shiboken::String::checkType(reinterpret_cast<PyTypeObject *>(%in)))
typeName = "QString";
-else if (%in == reinterpret_cast<PyObject*>(&PyFloat_Type))
+else if (%in == reinterpret_cast<PyObject *>(&PyFloat_Type))
typeName = "double"; // float is a UserType in QVariant.
-else if (%in == reinterpret_cast<PyObject*>(&PyLong_Type))
+else if (%in == reinterpret_cast<PyObject *>(&PyLong_Type))
typeName = "int"; // long is a UserType in QVariant.
else if (Py_TYPE(%in) == SbkObjectType_TypeF())
- typeName = Shiboken::ObjectType::getOriginalName((SbkObjectType*)%in);
+ typeName = Shiboken::ObjectType::getOriginalName((SbkObjectType *)%in);
else
typeName = reinterpret_cast<PyTypeObject *>(%in)->tp_name;
%out = QVariant::nameToType(typeName);
@@ -1825,7 +1830,7 @@ PyObject *%out;
PyTypeObject *pyType = nullptr;
if (typeName)
pyType = Shiboken::Conversions::getPythonTypeObject(typeName);
-%out = pyType ? (reinterpret_cast<PyObject*>(pyType)) : Py_None;
+%out = pyType ? (reinterpret_cast<PyObject *>(pyType)) : Py_None;
Py_INCREF(%out);
return %out;
// @snippet return-qvariant-type
diff --git a/sources/pyside2/PySide2/glue/qtgui.cpp b/sources/pyside2/PySide2/glue/qtgui.cpp
index aef9e4b59..5be8cc287 100644
--- a/sources/pyside2/PySide2/glue/qtgui.cpp
+++ b/sources/pyside2/PySide2/glue/qtgui.cpp
@@ -72,7 +72,7 @@ if (QTransform::squareToQuad(%1, _result)) {
// @snippet qtransform-squaretoquad
// @snippet qbitmap-fromdata
-uchar *buffer = reinterpret_cast<uchar*>(Shiboken::Buffer::getPointer(%PYARG_2));
+uchar *buffer = reinterpret_cast<uchar *>(Shiboken::Buffer::getPointer(%PYARG_2));
QBitmap %0 = QBitmap::fromData(%1, buffer, %3);
%PYARG_0 = %CONVERTTOPYTHON[QBitmap](%0);
// @snippet qbitmap-fromdata
@@ -102,7 +102,7 @@ return %CONVERTTOPYTHON[int](item);
// @snippet qtextblock-setuserdata
const QTextDocument *doc = %CPPSELF.document();
if (doc) {
- Shiboken::AutoDecRef pyDocument(%CONVERTTOPYTHON[QTextDocument*](doc));
+ Shiboken::AutoDecRef pyDocument(%CONVERTTOPYTHON[QTextDocument *](doc));
Shiboken::Object::setParent(pyDocument, %PYARG_1);
}
// @snippet qtextblock-setuserdata
@@ -110,7 +110,7 @@ if (doc) {
// @snippet qtextblock-userdata
const QTextDocument *doc = %CPPSELF.document();
if (doc) {
- Shiboken::AutoDecRef pyDocument(%CONVERTTOPYTHON[QTextDocument*](doc));
+ Shiboken::AutoDecRef pyDocument(%CONVERTTOPYTHON[QTextDocument *](doc));
Shiboken::Object::setParent(pyDocument, %PYARG_0);
}
// @snippet qtextblock-userdata
@@ -138,7 +138,7 @@ for (int i = 0, i_max = %CPPSELF.count(); i < i_max; ++i){
// @snippet qpolygon-operatorlowerlower
// %FUNCTION_NAME()
*%CPPSELF << %1;
-%PYARG_0 = %CONVERTTOPYTHON[QPolygon*](%CPPSELF);
+%PYARG_0 = %CONVERTTOPYTHON[QPolygon *](%CPPSELF);
// @snippet qpolygon-operatorlowerlower
// @snippet qpixmap
@@ -372,7 +372,7 @@ if (%CPPSELF.%FUNCTION_NAME(%1, &p)) {
// Clear parent from the old child
QStandardItem *_i = %CPPSELF->child(%1, %2);
if (_i) {
- PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
+ PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem *](_i);
Shiboken::Object::setParent(nullptr, _pyI);
}
// @snippet qstandarditem-setchild-1
@@ -381,7 +381,7 @@ if (_i) {
// Clear parent from the old child
QStandardItem *_i = %CPPSELF->child(%1);
if (_i) {
- PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
+ PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem *](_i);
Shiboken::Object::setParent(nullptr, _pyI);
}
// @snippet qstandarditem-setchild-2
@@ -395,7 +395,7 @@ bool ret = !(&%CPPSELF == %1);
// Clear parent from the old child
QStandardItem *_i = %CPPSELF->item(%1, %2);
if (_i) {
- PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
+ PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem *](_i);
Shiboken::Object::setParent(nullptr, _pyI);
}
// @snippet qstandarditemmodel-setitem-1
@@ -404,7 +404,7 @@ if (_i) {
// Clear parent from the old child
QStandardItem *_i = %CPPSELF->item(%1);
if (_i) {
- PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
+ PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem *](_i);
Shiboken::Object::setParent(nullptr, _pyI);
}
// @snippet qstandarditemmodel-setitem-2
@@ -413,7 +413,7 @@ if (_i) {
// Clear parent from the old child
QStandardItem *_i = %CPPSELF->verticalHeaderItem(%1);
if (_i) {
- PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
+ PyObject *_pyI = %CONVERTTOPYTHON[QStandardItem *](_i);
Shiboken::Object::setParent(nullptr, _pyI);
}
// @snippet qstandarditemmodel-setverticalheaderitem
@@ -503,7 +503,7 @@ static void QGuiApplicationConstructor(PyObject *self, PyObject *pyargv, QGuiApp
PyObject *stringlist = PyTuple_GET_ITEM(pyargv, 0);
if (Shiboken::listToArgcArgv(stringlist, &argc, &argv, "PySideApp")) {
*cptr = new QGuiApplicationWrapper(argc, argv, 0);
- Shiboken::Object::releaseOwnership(reinterpret_cast<SbkObject*>(self));
+ Shiboken::Object::releaseOwnership(reinterpret_cast<SbkObject *>(self));
PySide::registerCleanupFunction(&PySide::destroyQCoreApplication);
}
}
diff --git a/sources/pyside2/PySide2/glue/qtmultimedia.cpp b/sources/pyside2/PySide2/glue/qtmultimedia.cpp
index 520b5c4fa..5a3f3a5e7 100644
--- a/sources/pyside2/PySide2/glue/qtmultimedia.cpp
+++ b/sources/pyside2/PySide2/glue/qtmultimedia.cpp
@@ -39,7 +39,8 @@
// @snippet upcast
%BEGIN_ALLOW_THREADS
-QObject* upcastedArg = %CONVERTTOCPP[QObject*](%PYARG_1);
+QObject * upcastedArg = %CONVERTTOCPP[QObject *](%PYARG_1);
+//XXX /|\ omitting this space crashes shiboken!
%CPPSELF.%FUNCTION_NAME(reinterpret_cast< %ARG1_TYPE >(upcastedArg));
%END_ALLOW_THREADS
// @snippet upcast
diff --git a/sources/pyside2/PySide2/glue/qtopengl.cpp b/sources/pyside2/PySide2/glue/qtopengl.cpp
index 6c106522c..25b6ee096 100644
--- a/sources/pyside2/PySide2/glue/qtopengl.cpp
+++ b/sources/pyside2/PySide2/glue/qtopengl.cpp
@@ -39,7 +39,7 @@
// @snippet qglbuffer-allocate
int size = (%2 < 0) ? %1.size() : %2;
-%CPPSELF.allocate((const void*) %1.data(), size);
+%CPPSELF.allocate(static_cast<const void *>(%1.data()), size);
// @snippet qglbuffer-allocate
// @snippet qglbuffer-read
@@ -47,7 +47,7 @@ char *data = new char[%3];
bool result = %CPPSELF.read(%1, data, %3);
QByteArray ret;
if (result)
- ret.append((const char*)data, %3);
+ ret.append(data, %3);
%PYARG_0 = PyTuple_New(2);
PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[bool](result));
PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QByteArray](ret));
@@ -56,12 +56,12 @@ delete[] data;
// @snippet qglbuffer-write
int size = (%3 < 0) ? %2.size() : %3;
-%CPPSELF.write(%1, (const void*) %2.data(), size);
+%CPPSELF.write(%1, static_cast<const void *>(%2.data()), size);
// @snippet qglbuffer-write
// @snippet qglbuffer-map
Py_ssize_t dataSize = %CPPSELF.size();
-void* data = %CPPSELF.map(%1);
+void *data = %CPPSELF.map(%1);
if (!data) {
Py_INCREF(Py_None);
diff --git a/sources/pyside2/PySide2/glue/qtscript.cpp b/sources/pyside2/PySide2/glue/qtscript.cpp
index 7efc26f3e..cf168d6bd 100644
--- a/sources/pyside2/PySide2/glue/qtscript.cpp
+++ b/sources/pyside2/PySide2/glue/qtscript.cpp
@@ -54,7 +54,7 @@ QVariant res = %CPPSELF.property(Shiboken::String::toCString(key.object())).toVa
if (res.isValid()) {
return %CONVERTTOPYTHON[QVariant](res);
} else {
- PyObject* errorType = PyInt_Check(_key) ? PyExc_IndexError : PyExc_KeyError;
+ PyObject *errorType = PyInt_Check(_key) ? PyExc_IndexError : PyExc_KeyError;
PyErr_SetString(errorType, "Key not found.");
return 0;
}
diff --git a/sources/pyside2/PySide2/glue/qtuitools.cpp b/sources/pyside2/PySide2/glue/qtuitools.cpp
index d0469e97d..552a9009c 100644
--- a/sources/pyside2/PySide2/glue/qtuitools.cpp
+++ b/sources/pyside2/PySide2/glue/qtuitools.cpp
@@ -48,14 +48,14 @@
#include <QFile>
#include <QWidget>
-static void createChildrenNameAttributes(PyObject* root, QObject* object)
+static void createChildrenNameAttributes(PyObject *root, QObject *object)
{
for (auto *child : object->children()) {
const QByteArray name = child->objectName().toLocal8Bit();
if (!name.isEmpty() && !name.startsWith("_") && !name.startsWith("qt_")) {
if (!PyObject_HasAttrString(root, name.constData())) {
- Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QObject*](child));
+ Shiboken::AutoDecRef pyChild(%CONVERTTOPYTHON[QObject *](child));
PyObject_SetAttrString(root, name.constData(), pyChild);
}
createChildrenNameAttributes(root, child);
@@ -64,15 +64,15 @@ static void createChildrenNameAttributes(PyObject* root, QObject* object)
}
}
-static PyObject* QUiLoadedLoadUiFromDevice(QUiLoader* self, QIODevice* dev, QWidget* parent)
+static PyObject *QUiLoadedLoadUiFromDevice(QUiLoader *self, QIODevice *dev, QWidget *parent)
{
- QWidget* wdg = self->load(dev, parent);
+ QWidget *wdg = self->load(dev, parent);
if (wdg) {
- PyObject* pyWdg = %CONVERTTOPYTHON[QWidget*](wdg);
+ PyObject *pyWdg = %CONVERTTOPYTHON[QWidget *](wdg);
createChildrenNameAttributes(pyWdg, wdg);
if (parent) {
- Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QWidget*](parent));
+ Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QWidget *](parent));
Shiboken::Object::setParent(pyParent, pyWdg);
}
return pyWdg;
@@ -83,7 +83,7 @@ static PyObject* QUiLoadedLoadUiFromDevice(QUiLoader* self, QIODevice* dev, QWid
return nullptr;
}
-static PyObject* QUiLoaderLoadUiFromFileName(QUiLoader* self, const QString& uiFile, QWidget* parent)
+static PyObject *QUiLoaderLoadUiFromFileName(QUiLoader *self, const QString &uiFile, QWidget *parent)
{
QFile fd(uiFile);
return QUiLoadedLoadUiFromDevice(self, &fd, parent);
diff --git a/sources/pyside2/PySide2/glue/qtwebkitwidgets.cpp b/sources/pyside2/PySide2/glue/qtwebkitwidgets.cpp
index 086ee3b85..c0f182747 100644
--- a/sources/pyside2/PySide2/glue/qtwebkitwidgets.cpp
+++ b/sources/pyside2/PySide2/glue/qtwebkitwidgets.cpp
@@ -38,7 +38,7 @@
****************************************************************************/
// @snippet qwebview-page
-SbkObject* _pyReturn = reinterpret_cast<SbkObject*>(%PYARG_0);
+auto _pyReturn = reinterpret_cast<SbkObject *>(%PYARG_0);
if (!Shiboken::Object::hasParentInfo(_pyReturn))
Shiboken::Object::setParent(%PYSELF, %PYARG_0);
// @snippet qwebview-page
@@ -67,7 +67,7 @@ if (_signalIndex == -1) {
if (_signalIndex == id) {
Shiboken::GilState gil;
- PyObject* self = (PyObject*)Shiboken::BindingManager::instance().retrieveWrapper(this);
+ auto self = reinterpret_cast<PyObject *>(Shiboken::BindingManager::instance().retrieveWrapper(this));
if (self) {
Shiboken::AutoDecRef _pyMethod(PyObject_GetAttrString(self, "shouldInterruptJavaScript"));
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
diff --git a/sources/pyside2/PySide2/glue/qtxml.cpp b/sources/pyside2/PySide2/glue/qtxml.cpp
index ff8be58e2..684ff33c4 100644
--- a/sources/pyside2/PySide2/glue/qtxml.cpp
+++ b/sources/pyside2/PySide2/glue/qtxml.cpp
@@ -38,13 +38,13 @@
****************************************************************************/
// @snippet qxmlentityresolver-resolveentity
-QXmlInputSource* _qxmlinputsource_arg_ = nullptr;
+QXmlInputSource *_qxmlinputsource_arg_ = nullptr;
%BEGIN_ALLOW_THREADS
%RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(%1, %2, _qxmlinputsource_arg_);
%END_ALLOW_THREADS
%PYARG_0 = PyTuple_New(2);
PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](%0));
-PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QXmlInputSource*](_qxmlinputsource_arg_));
+PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QXmlInputSource *](_qxmlinputsource_arg_));
// @snippet qxmlentityresolver-resolveentity
// @snippet qdomdocument-setcontent
diff --git a/sources/pyside2/PySide2/glue/qtxmlpatterns.cpp b/sources/pyside2/PySide2/glue/qtxmlpatterns.cpp
index b559ad1d4..75ad3b265 100644
--- a/sources/pyside2/PySide2/glue/qtxmlpatterns.cpp
+++ b/sources/pyside2/PySide2/glue/qtxmlpatterns.cpp
@@ -38,6 +38,6 @@
****************************************************************************/
// @snippet qxmlschemavalidator-schema
-QXmlSchema* %0 = new QXmlSchema(%CPPSELF.schema());
-%PYARG_0 = %CONVERTTOPYTHON[QXmlSchema*](%0);
+QXmlSchema *%0 = new QXmlSchema(%CPPSELF.schema());
+%PYARG_0 = %CONVERTTOPYTHON[QXmlSchema *](%0);
// @snippet qxmlschemavalidator-schema
diff --git a/sources/pyside2/PySide2/pysideqtesttouch.h b/sources/pyside2/PySide2/pysideqtesttouch.h
index 60d3bbe25..115c7835e 100644
--- a/sources/pyside2/PySide2/pysideqtesttouch.h
+++ b/sources/pyside2/PySide2/pysideqtesttouch.h
@@ -66,28 +66,28 @@ namespace QTest
if (commitWhenDestroyed)
commit();
}
- PySideQTouchEventSequence* press(int touchId, const QPoint &pt, QWindow *window = 0)
+ PySideQTouchEventSequence *press(int touchId, const QPoint &pt, QWindow *window = nullptr)
{
QTouchEvent::TouchPoint &p = point(touchId);
p.setScreenPos(mapToScreen(window, pt));
p.setState(Qt::TouchPointPressed);
return this;
}
- PySideQTouchEventSequence* move(int touchId, const QPoint &pt, QWindow *window = 0)
+ PySideQTouchEventSequence *move(int touchId, const QPoint &pt, QWindow *window = nullptr)
{
QTouchEvent::TouchPoint &p = point(touchId);
p.setScreenPos(mapToScreen(window, pt));
p.setState(Qt::TouchPointMoved);
return this;
}
- PySideQTouchEventSequence* release(int touchId, const QPoint &pt, QWindow *window = 0)
+ PySideQTouchEventSequence *release(int touchId, const QPoint &pt, QWindow *window = nullptr)
{
QTouchEvent::TouchPoint &p = point(touchId);
p.setScreenPos(mapToScreen(window, pt));
p.setState(Qt::TouchPointReleased);
return this;
}
- PySideQTouchEventSequence* stationary(int touchId)
+ PySideQTouchEventSequence *stationary(int touchId)
{
QTouchEvent::TouchPoint &p = pointOrPreviousPoint(touchId);
p.setState(Qt::TouchPointStationary);
@@ -95,7 +95,7 @@ namespace QTest
}
#ifdef QT_WIDGETS_LIB
- PySideQTouchEventSequence* press(int touchId, const QPoint &pt, QWidget *widget = 0)
+ PySideQTouchEventSequence *press(int touchId, const QPoint &pt, QWidget *widget = nullptr)
{
QTouchEvent::TouchPoint &p = point(touchId);
p.setScreenPos(mapToScreen(widget, pt));
@@ -103,7 +103,7 @@ namespace QTest
return this;
}
- PySideQTouchEventSequence* move(int touchId, const QPoint &pt, QWidget *widget = 0)
+ PySideQTouchEventSequence *move(int touchId, const QPoint &pt, QWidget *widget = nullptr)
{
QTouchEvent::TouchPoint &p = point(touchId);
p.setScreenPos(mapToScreen(widget, pt));
@@ -111,7 +111,7 @@ namespace QTest
return this;
}
- PySideQTouchEventSequence* release(int touchId, const QPoint &pt, QWidget *widget = 0)
+ PySideQTouchEventSequence *release(int touchId, const QPoint &pt, QWidget *widget = nullptr)
{
QTouchEvent::TouchPoint &p = point(touchId);
p.setScreenPos(mapToScreen(widget, pt));
@@ -198,14 +198,14 @@ private:
QTouchDevice *device;
bool commitWhenDestroyed;
#ifdef QT_WIDGETS_LIB
- friend PySideQTouchEventSequence* generateTouchEvent(QWidget *, QTouchDevice*, bool);
+ friend PySideQTouchEventSequence *generateTouchEvent(QWidget *, QTouchDevice *, bool);
#endif
- friend PySideQTouchEventSequence* generateTouchEvent(QWindow *, QTouchDevice*, bool);
+ friend PySideQTouchEventSequence *generateTouchEvent(QWindow *, QTouchDevice *, bool);
};
#ifdef QT_WIDGETS_LIB
inline
- PySideQTouchEventSequence* generateTouchEvent(QWidget *widget,
+ PySideQTouchEventSequence *generateTouchEvent(QWidget *widget,
QTouchDevice *device,
bool autoCommit = true)
{
@@ -213,7 +213,7 @@ private:
}
#endif
inline
- PySideQTouchEventSequence* generateTouchEvent(QWindow *window,
+ PySideQTouchEventSequence *generateTouchEvent(QWindow *window,
QTouchDevice *device,
bool autoCommit = true)
{
diff --git a/sources/pyside2/PySide2/qpytextobject.h b/sources/pyside2/PySide2/qpytextobject.h
index ecdfa7fb5..1968ac385 100644
--- a/sources/pyside2/PySide2/qpytextobject.h
+++ b/sources/pyside2/PySide2/qpytextobject.h
@@ -54,9 +54,10 @@ class QPyTextObject : public QObject, public QTextObjectInterface
Q_OBJECT
Q_INTERFACES(QTextObjectInterface)
public:
- QPyTextObject(QObject* parent = 0) : QObject(parent) {}
- void drawObject(QPainter* painter, const QRectF& rect, QTextDocument* doc, int posInDocument, const QTextFormat& format ) = 0;
- QSizeF intrinsicSize(QTextDocument* doc, int posInDocument, const QTextFormat& format ) = 0;
+ QPyTextObject(QObject *parent = nullptr) : QObject(parent) {}
+ void drawObject(QPainter *painter, const QRectF &rect, QTextDocument *doc,
+ int posInDocument, const QTextFormat &format) = 0;
+ QSizeF intrinsicSize(QTextDocument *doc, int posInDocument, const QTextFormat &format) = 0;
};
#endif
diff --git a/sources/pyside2/libpyside/destroylistener.cpp b/sources/pyside2/libpyside/destroylistener.cpp
index c6dc54713..319a126cf 100644
--- a/sources/pyside2/libpyside/destroylistener.cpp
+++ b/sources/pyside2/libpyside/destroylistener.cpp
@@ -42,7 +42,7 @@
#include <shiboken.h>
-PySide::DestroyListener* PySide::DestroyListener::m_instance = 0;
+PySide::DestroyListener *PySide::DestroyListener::m_instance = nullptr;
namespace PySide
{
@@ -53,7 +53,7 @@ struct DestroyListenerPrivate
};
-DestroyListener* DestroyListener::instance()
+DestroyListener *DestroyListener::instance()
{
if (!m_instance)
m_instance = new DestroyListener(0);
@@ -71,19 +71,19 @@ void DestroyListener::destroy()
void DestroyListener::listen(QObject *obj)
{
- SbkObject* wrapper = Shiboken::BindingManager::instance().retrieveWrapper(obj);
+ SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(obj);
if (!wrapper) // avoid problem with multiple inheritance
return;
if (Py_IsInitialized() == 0)
onObjectDestroyed(obj);
else
- QObject::connect(obj, SIGNAL(destroyed(QObject*)), this, SLOT(onObjectDestroyed(QObject*)), Qt::DirectConnection);
+ QObject::connect(obj, SIGNAL(destroyed(QObject *)), this, SLOT(onObjectDestroyed(QObject *)), Qt::DirectConnection);
}
-void DestroyListener::onObjectDestroyed(QObject* obj)
+void DestroyListener::onObjectDestroyed(QObject *obj)
{
- SbkObject* wrapper = Shiboken::BindingManager::instance().retrieveWrapper(obj);
+ SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(obj);
if (wrapper) //make sure the object exists before destroy
Shiboken::Object::destroy(wrapper, obj);
}
diff --git a/sources/pyside2/libpyside/destroylistener.h b/sources/pyside2/libpyside/destroylistener.h
index b1a0597c5..dedcca662 100644
--- a/sources/pyside2/libpyside/destroylistener.h
+++ b/sources/pyside2/libpyside/destroylistener.h
@@ -52,16 +52,16 @@ class PYSIDE_API DestroyListener : public QObject
{
Q_OBJECT
public:
- PYSIDE_DEPRECATED(static DestroyListener* instance());
+ PYSIDE_DEPRECATED(static DestroyListener *instance());
static void destroy();
- void listen(QObject* obj);
+ void listen(QObject *obj);
public Q_SLOTS:
- void onObjectDestroyed(QObject* obj);
+ void onObjectDestroyed(QObject *obj);
private:
- static DestroyListener* m_instance;
- DestroyListenerPrivate* m_d;
+ static DestroyListener *m_instance;
+ DestroyListenerPrivate *m_d;
DestroyListener(QObject *parent);
~DestroyListener() override;
};
diff --git a/sources/pyside2/libpyside/globalreceiverv2.cpp b/sources/pyside2/libpyside/globalreceiverv2.cpp
index 43ce50a75..170cbf22f 100644
--- a/sources/pyside2/libpyside/globalreceiverv2.cpp
+++ b/sources/pyside2/libpyside/globalreceiverv2.cpp
@@ -62,27 +62,27 @@ class DynamicSlotDataV2
{
Q_DISABLE_COPY(DynamicSlotDataV2)
public:
- DynamicSlotDataV2(PyObject* callback, GlobalReceiverV2* parent);
+ DynamicSlotDataV2(PyObject *callback, GlobalReceiverV2 *parent);
~DynamicSlotDataV2();
- int addSlot(const char* signature);
- int id(const char* signature) const;
- PyObject* callback();
+ int addSlot(const char *signature);
+ int id(const char *signature) const;
+ PyObject *callback();
QByteArray hash() const;
void notify();
- static void onCallbackDestroyed(void* data);
+ static void onCallbackDestroyed(void *data);
static QByteArray hash(PyObject *callback);
private:
bool m_isMethod;
- PyObject* m_callback;
- PyObject* m_pythonSelf;
- PyObject* m_pyClass;
- PyObject* m_weakRef;
+ PyObject *m_callback;
+ PyObject *m_pythonSelf;
+ PyObject *m_pyClass;
+ PyObject *m_weakRef;
QMap<QByteArray, int> m_signatures;
- GlobalReceiverV2* m_parent;
+ GlobalReceiverV2 *m_parent;
QByteArray m_hash;
};
@@ -90,7 +90,7 @@ class DynamicSlotDataV2
using namespace PySide;
-DynamicSlotDataV2::DynamicSlotDataV2(PyObject* callback, GlobalReceiverV2* parent)
+DynamicSlotDataV2::DynamicSlotDataV2(PyObject *callback, GlobalReceiverV2 *parent)
: m_pythonSelf(0), m_pyClass(0), m_weakRef(0), m_parent(parent)
{
Shiboken::GilState gil;
@@ -124,7 +124,7 @@ QByteArray DynamicSlotDataV2::hash() const
return m_hash;
}
-QByteArray DynamicSlotDataV2::hash(PyObject* callback)
+QByteArray DynamicSlotDataV2::hash(PyObject *callback)
{
Shiboken::GilState gil;
if (PyMethod_Check(callback)) {
@@ -134,9 +134,9 @@ QByteArray DynamicSlotDataV2::hash(PyObject* callback)
return QByteArray::number(qlonglong(PyObject_Hash(callback)));
}
-PyObject* DynamicSlotDataV2::callback()
+PyObject *DynamicSlotDataV2::callback()
{
- PyObject* callback = m_callback;
+ PyObject *callback = m_callback;
//create a callback based on method data
if (m_isMethod)
@@ -151,13 +151,13 @@ PyObject* DynamicSlotDataV2::callback()
return callback;
}
-int DynamicSlotDataV2::id(const char* signature) const
+int DynamicSlotDataV2::id(const char *signature) const
{
const auto it = m_signatures.constFind(signature);
return it != m_signatures.cend() ? it.value() : -1;
}
-int DynamicSlotDataV2::addSlot(const char* signature)
+int DynamicSlotDataV2::addSlot(const char *signature)
{
int index = id(signature);
if (index == -1)
@@ -167,7 +167,7 @@ int DynamicSlotDataV2::addSlot(const char* signature)
void DynamicSlotDataV2::onCallbackDestroyed(void *data)
{
- DynamicSlotDataV2* self = reinterpret_cast<DynamicSlotDataV2*>(data);
+ auto self = reinterpret_cast<DynamicSlotDataV2 *>(data);
self->m_weakRef = 0;
Py_BEGIN_ALLOW_THREADS
delete self->m_parent;
@@ -222,12 +222,12 @@ GlobalReceiverV2::~GlobalReceiverV2()
delete data;
}
-int GlobalReceiverV2::addSlot(const char* signature)
+int GlobalReceiverV2::addSlot(const char *signature)
{
return m_data->addSlot(signature);
}
-void GlobalReceiverV2::incRef(const QObject* link)
+void GlobalReceiverV2::incRef(const QObject *link)
{
if (link) {
if (!m_refs.contains(link)) {
@@ -247,7 +247,7 @@ void GlobalReceiverV2::incRef(const QObject* link)
}
}
-void GlobalReceiverV2::decRef(const QObject* link)
+void GlobalReceiverV2::decRef(const QObject *link)
{
if (m_refs.empty())
return;
@@ -273,7 +273,7 @@ void GlobalReceiverV2::decRef(const QObject* link)
}
-int GlobalReceiverV2::refCount(const QObject* link) const
+int GlobalReceiverV2::refCount(const QObject *link) const
{
if (link)
return m_refs.count(link);
@@ -283,7 +283,7 @@ int GlobalReceiverV2::refCount(const QObject* link) const
void GlobalReceiverV2::notify()
{
- const auto objSet = QSet<const QObject*>::fromList(m_refs);
+ const auto objSet = QSet<const QObject *>::fromList(m_refs);
Py_BEGIN_ALLOW_THREADS
for (const QObject *o : objSet) {
QMetaObject::disconnect(o, DESTROY_SIGNAL_ID, this, DESTROY_SLOT_ID);
@@ -297,17 +297,17 @@ QByteArray GlobalReceiverV2::hash() const
return m_data->hash();
}
-QByteArray GlobalReceiverV2::hash(PyObject* callback)
+QByteArray GlobalReceiverV2::hash(PyObject *callback)
{
return DynamicSlotDataV2::hash(callback);
}
-const QMetaObject* GlobalReceiverV2::metaObject() const
+const QMetaObject *GlobalReceiverV2::metaObject() const
{
return const_cast<GlobalReceiverV2 *>(this)->m_metaObject.update();
}
-int GlobalReceiverV2::qt_metacall(QMetaObject::Call call, int id, void** args)
+int GlobalReceiverV2::qt_metacall(QMetaObject::Call call, int id, void **args)
{
Shiboken::GilState gil;
Q_ASSERT(call == QMetaObject::InvokeMetaMethod);
@@ -328,7 +328,7 @@ int GlobalReceiverV2::qt_metacall(QMetaObject::Call call, int id, void** args)
if (id == DESTROY_SLOT_ID) {
if (m_refs.empty())
return -1;
- QObject *obj = *reinterpret_cast<QObject**>(args[1]);
+ auto obj = *reinterpret_cast<QObject **>(args[1]);
incRef(); //keep the object live (safe ref)
m_refs.removeAll(obj); // remove all refs to this object
decRef(); //remove the safe ref
diff --git a/sources/pyside2/libpyside/globalreceiverv2.h b/sources/pyside2/libpyside/globalreceiverv2.h
index b92be93a8..433f587a9 100644
--- a/sources/pyside2/libpyside/globalreceiverv2.h
+++ b/sources/pyside2/libpyside/globalreceiverv2.h
@@ -82,8 +82,8 @@ public:
/**
* Reimplemented function from QObject
**/
- int qt_metacall(QMetaObject::Call call, int id, void** args) override;
- const QMetaObject* metaObject() const override;
+ int qt_metacall(QMetaObject::Call call, int id, void **args) override;
+ const QMetaObject *metaObject() const override;
/**
* Add a extra slot to this object
@@ -91,7 +91,7 @@ public:
* @param signature The signature of the slot to be added
* @return The index of this slot on metaobject
**/
- int addSlot(const char* signature);
+ int addSlot(const char *signature);
/**
* Notify to GlobalReceiver about when a new connection was made
@@ -103,14 +103,14 @@ public:
*
* @param link This is a optional paramenter used to link the ref to some QObject life
**/
- void incRef(const QObject* link = 0);
+ void incRef(const QObject *link = nullptr);
/**
* Used to decrement the reference of the GlobalReceiver object
*
* @param link This is a optional paramenter used to dismiss the link ref to some QObject
**/
- void decRef(const QObject* link = 0);
+ void decRef(const QObject *link = nullptr);
/*
* Return the count of refs which the GlobalReceiver has
@@ -118,7 +118,7 @@ public:
* @param link If any QObject was passed, the function return the number of references relative to this 'link' object
* @return The number of references
**/
- int refCount(const QObject* link) const;
+ int refCount(const QObject *link) const;
/**
* Use to retrieve the unique hash of this GlobalReceiver object
@@ -133,7 +133,7 @@ public:
* @param callback The Python callable object used to calculate the id
* @return a string with a unique id based on GlobalReceiver contents
**/
- static QByteArray hash(PyObject* callback);
+ static QByteArray hash(PyObject *callback);
const MetaObjectBuilder &metaObjectBuilder() const { return m_metaObject; }
MetaObjectBuilder &metaObjectBuilder() { return m_metaObject; }
@@ -141,7 +141,7 @@ public:
private:
MetaObjectBuilder m_metaObject;
DynamicSlotDataV2 *m_data;
- QList<const QObject*> m_refs;
+ QList<const QObject *> m_refs;
SharedMap m_sharedMap;
};
diff --git a/sources/pyside2/libpyside/pyside.cpp b/sources/pyside2/libpyside/pyside.cpp
index fff28a9e7..9ee20f461 100644
--- a/sources/pyside2/libpyside/pyside.cpp
+++ b/sources/pyside2/libpyside/pyside.cpp
@@ -72,7 +72,7 @@
#include <typeinfo>
static QStack<PySide::CleanupFunction> cleanupFunctionList;
-static void* qobjectNextAddr;
+static void *qobjectNextAddr;
QT_BEGIN_NAMESPACE
extern bool qRegisterResourceData(int, const unsigned char *, const unsigned char *,
@@ -94,7 +94,7 @@ void init(PyObject *module)
SignalManager::instance();
}
-static bool _setProperty(PyObject* qObj, PyObject *name, PyObject *value, bool *accept)
+static bool _setProperty(PyObject *qObj, PyObject *name, PyObject *value, bool *accept)
{
QByteArray propName(Shiboken::String::toCString(name));
propName[0] = std::toupper(propName[0]);
@@ -112,14 +112,14 @@ static bool _setProperty(PyObject* qObj, PyObject *name, PyObject *value, bool *
Shiboken::AutoDecRef attr(PyObject_GenericGetAttr(qObj, name));
if (PySide::Property::checkType(attr)) {
*accept = true;
- if (PySide::Property::setValue(reinterpret_cast<PySideProperty*>(attr.object()), qObj, value) < 0)
+ if (PySide::Property::setValue(reinterpret_cast<PySideProperty *>(attr.object()), qObj, value) < 0)
return false;
}
}
return true;
}
-bool fillQtProperties(PyObject* qObj, const QMetaObject* metaObj, PyObject* kwds, const char** blackList, unsigned int blackListSize)
+bool fillQtProperties(PyObject *qObj, const QMetaObject *metaObj, PyObject *kwds, const char **blackList, unsigned int blackListSize)
{
PyObject *key, *value;
@@ -170,11 +170,11 @@ void runCleanupFunctions()
PySide::DestroyListener::destroy();
}
-static void destructionVisitor(SbkObject* pyObj, void* data)
+static void destructionVisitor(SbkObject *pyObj, void *data)
{
- void** realData = reinterpret_cast<void**>(data);
- SbkObject* pyQApp = reinterpret_cast<SbkObject*>(realData[0]);
- PyTypeObject* pyQObjectType = reinterpret_cast<PyTypeObject*>(realData[1]);
+ auto realData = reinterpret_cast<void **>(data);
+ auto pyQApp = reinterpret_cast<SbkObject *>(realData[0]);
+ auto pyQObjectType = reinterpret_cast<PyTypeObject *>(realData[1]);
if (pyObj != pyQApp && PyObject_TypeCheck(pyObj, pyQObjectType)) {
if (Shiboken::Object::hasOwnership(pyObj) && Shiboken::Object::isValid(pyObj, false)) {
@@ -190,17 +190,17 @@ static void destructionVisitor(SbkObject* pyObj, void* data)
void destroyQCoreApplication()
{
- QCoreApplication* app = QCoreApplication::instance();
+ QCoreApplication *app = QCoreApplication::instance();
if (!app)
return;
SignalManager::instance().clear();
- Shiboken::BindingManager& bm = Shiboken::BindingManager::instance();
- SbkObject* pyQApp = bm.retrieveWrapper(app);
- PyTypeObject* pyQObjectType = Shiboken::Conversions::getPythonTypeObject("QObject*");
+ Shiboken::BindingManager &bm = Shiboken::BindingManager::instance();
+ SbkObject *pyQApp = bm.retrieveWrapper(app);
+ PyTypeObject *pyQObjectType = Shiboken::Conversions::getPythonTypeObject("QObject*");
assert(pyQObjectType);
- void* data[2] = {pyQApp, pyQObjectType};
+ void *data[2] = {pyQApp, pyQObjectType};
bm.visitAllPyObjects(&destructionVisitor, &data);
// in the end destroy app
@@ -214,26 +214,26 @@ void destroyQCoreApplication()
MakeSingletonQAppWrapper(NULL);
}
-std::size_t getSizeOfQObject(SbkObjectType* type)
+std::size_t getSizeOfQObject(SbkObjectType *type)
{
return retrieveTypeUserData(type)->cppObjSize;
}
-void initDynamicMetaObject(SbkObjectType* type, const QMetaObject* base, std::size_t cppObjSize)
+void initDynamicMetaObject(SbkObjectType *type, const QMetaObject *base, std::size_t cppObjSize)
{
//create DynamicMetaObject based on python type
auto userData =
- new TypeUserData(reinterpret_cast<PyTypeObject*>(type), base, cppObjSize);
+ new TypeUserData(reinterpret_cast<PyTypeObject *>(type), base, cppObjSize);
userData->mo.update();
Shiboken::ObjectType::setTypeUserData(type, userData, Shiboken::callCppDestructor<TypeUserData>);
//initialize staticQMetaObject property
void *metaObjectPtr = const_cast<QMetaObject *>(userData->mo.update());
- static SbkConverter* converter = Shiboken::Conversions::getConverter("QMetaObject");
+ static SbkConverter *converter = Shiboken::Conversions::getConverter("QMetaObject");
if (!converter)
return;
Shiboken::AutoDecRef pyMetaObject(Shiboken::Conversions::pointerToPython(converter, metaObjectPtr));
- PyObject_SetAttrString(reinterpret_cast<PyObject*>(type), "staticMetaObject", pyMetaObject);
+ PyObject_SetAttrString(reinterpret_cast<PyObject *>(type), "staticMetaObject", pyMetaObject);
}
TypeUserData *retrieveTypeUserData(SbkObjectType *sbkTypeObj)
@@ -266,23 +266,23 @@ const QMetaObject *retrieveMetaObject(PyObject *pyObj)
return retrieveMetaObject(pyTypeObj);
}
-void initDynamicMetaObject(SbkObjectType* type, const QMetaObject* base)
+void initDynamicMetaObject(SbkObjectType *type, const QMetaObject *base)
{
initDynamicMetaObject(type, base, 0);
}
void initQObjectSubType(SbkObjectType *type, PyObject *args, PyObject * /* kwds */)
{
- PyTypeObject* qObjType = Shiboken::Conversions::getPythonTypeObject("QObject*");
+ PyTypeObject *qObjType = Shiboken::Conversions::getPythonTypeObject("QObject*");
QByteArray className(Shiboken::String::toCString(PyTuple_GET_ITEM(args, 0)));
- PyObject* bases = PyTuple_GET_ITEM(args, 1);
+ PyObject *bases = PyTuple_GET_ITEM(args, 1);
int numBases = PyTuple_GET_SIZE(bases);
TypeUserData *userData = nullptr;
for (int i = 0; i < numBases; ++i) {
- PyTypeObject* base = reinterpret_cast<PyTypeObject*>(PyTuple_GET_ITEM(bases, i));
+ auto base = reinterpret_cast<PyTypeObject *>(PyTuple_GET_ITEM(bases, i));
if (PyType_IsSubtype(base, qObjType)) {
userData = retrieveTypeUserData(base);
break;
@@ -295,14 +295,14 @@ void initQObjectSubType(SbkObjectType *type, PyObject *args, PyObject * /* kwds
initDynamicMetaObject(type, userData->mo.update(), userData->cppObjSize);
}
-PyObject* getMetaDataFromQObject(QObject* cppSelf, PyObject* self, PyObject* name)
+PyObject *getMetaDataFromQObject(QObject *cppSelf, PyObject *self, PyObject *name)
{
- PyObject* attr = PyObject_GenericGetAttr(self, name);
- if (!Shiboken::Object::isValid(reinterpret_cast<SbkObject*>(self), false))
+ PyObject *attr = PyObject_GenericGetAttr(self, name);
+ if (!Shiboken::Object::isValid(reinterpret_cast<SbkObject *>(self), false))
return attr;
if (attr && Property::checkType(attr)) {
- PyObject *value = Property::getValue(reinterpret_cast<PySideProperty*>(attr), self);
+ PyObject *value = Property::getValue(reinterpret_cast<PySideProperty *>(attr), self);
Py_DECREF(attr);
if (!value)
return 0;
@@ -312,17 +312,17 @@ PyObject* getMetaDataFromQObject(QObject* cppSelf, PyObject* self, PyObject* nam
//mutate native signals to signal instance type
if (attr && PyObject_TypeCheck(attr, PySideSignalTypeF())) {
- PyObject* signal = reinterpret_cast<PyObject*>(Signal::initialize(reinterpret_cast<PySideSignal*>(attr), name, self));
- PyObject_SetAttr(self, name, reinterpret_cast<PyObject*>(signal));
+ PyObject *signal = reinterpret_cast<PyObject *>(Signal::initialize(reinterpret_cast<PySideSignal *>(attr), name, self));
+ PyObject_SetAttr(self, name, reinterpret_cast<PyObject *>(signal));
return signal;
}
//search on metaobject (avoid internal attributes started with '__')
if (!attr) {
- const char* cname = Shiboken::String::toCString(name);
+ const char *cname = Shiboken::String::toCString(name);
uint cnameLen = qstrlen(cname);
if (std::strncmp("__", cname, 2)) {
- const QMetaObject* metaObject = cppSelf->metaObject();
+ const QMetaObject *metaObject = cppSelf->metaObject();
//signal
QList<QMetaMethod> signalList;
for(int i=0, i_max = metaObject->methodCount(); i < i_max; i++) {
@@ -334,7 +334,7 @@ PyObject* getMetaDataFromQObject(QObject* cppSelf, PyObject* self, PyObject* nam
if (method.methodType() == QMetaMethod::Signal) {
signalList.append(method);
} else {
- PySideMetaFunction* func = MetaFunction::newObject(cppSelf, i);
+ PySideMetaFunction *func = MetaFunction::newObject(cppSelf, i);
if (func) {
PyObject *result = reinterpret_cast<PyObject *>(func);
PyObject_SetAttr(self, name, result);
@@ -344,7 +344,7 @@ PyObject* getMetaDataFromQObject(QObject* cppSelf, PyObject* self, PyObject* nam
}
}
if (!signalList.empty()) {
- PyObject* pySignal = reinterpret_cast<PyObject*>(Signal::newObjectFromMethod(self, signalList));
+ PyObject *pySignal = reinterpret_cast<PyObject *>(Signal::newObjectFromMethod(self, signalList));
PyObject_SetAttr(self, name, pySignal);
return pySignal;
}
@@ -353,24 +353,24 @@ PyObject* getMetaDataFromQObject(QObject* cppSelf, PyObject* self, PyObject* nam
return attr;
}
-bool inherits(PyTypeObject* objType, const char* class_name)
+bool inherits(PyTypeObject *objType, const char *class_name)
{
if (strcmp(objType->tp_name, class_name) == 0)
return true;
- PyTypeObject* base = objType->tp_base;
+ PyTypeObject *base = objType->tp_base;
if (base == 0)
return false;
return inherits(base, class_name);
}
-void* nextQObjectMemoryAddr()
+void *nextQObjectMemoryAddr()
{
return qobjectNextAddr;
}
-void setNextQObjectMemoryAddr(void* addr)
+void setNextQObjectMemoryAddr(void *addr)
{
qobjectNextAddr = addr;
}
@@ -379,27 +379,27 @@ void setNextQObjectMemoryAddr(void* addr)
// A QSharedPointer is used with a deletion function to invalidate a pointer
// when the property value is cleared. This should be a QSharedPointer with
-// a void* pointer, but that isn't allowed
+// a void *pointer, but that isn't allowed
typedef char any_t;
Q_DECLARE_METATYPE(QSharedPointer<any_t>);
namespace PySide
{
-static void invalidatePtr(any_t* object)
+static void invalidatePtr(any_t *object)
{
Shiboken::GilState state;
- SbkObject* wrapper = Shiboken::BindingManager::instance().retrieveWrapper(object);
+ SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(object);
if (wrapper != NULL)
Shiboken::BindingManager::instance().releaseWrapper(wrapper);
}
static const char invalidatePropertyName[] = "_PySideInvalidatePtr";
-PyObject* getWrapperForQObject(QObject* cppSelf, SbkObjectType* sbk_type)
+PyObject *getWrapperForQObject(QObject *cppSelf, SbkObjectType *sbk_type)
{
- PyObject* pyOut = reinterpret_cast<PyObject *>(Shiboken::BindingManager::instance().retrieveWrapper(cppSelf));
+ PyObject *pyOut = reinterpret_cast<PyObject *>(Shiboken::BindingManager::instance().retrieveWrapper(cppSelf));
if (pyOut) {
Py_INCREF(pyOut);
return pyOut;
@@ -410,7 +410,7 @@ PyObject* getWrapperForQObject(QObject* cppSelf, SbkObjectType* sbk_type)
// set and check if it's created after the set call
QVariant existing = cppSelf->property(invalidatePropertyName);
if (!existing.isValid()) {
- QSharedPointer<any_t> shared_with_del(reinterpret_cast<any_t*>(cppSelf), invalidatePtr);
+ QSharedPointer<any_t> shared_with_del(reinterpret_cast<any_t *>(cppSelf), invalidatePtr);
cppSelf->setProperty(invalidatePropertyName, QVariant::fromValue(shared_with_del));
pyOut = reinterpret_cast<PyObject *>(Shiboken::BindingManager::instance().retrieveWrapper(cppSelf));
if (pyOut) {
@@ -419,7 +419,7 @@ PyObject* getWrapperForQObject(QObject* cppSelf, SbkObjectType* sbk_type)
}
}
- const char* typeName = typeid(*cppSelf).name();
+ const char *typeName = typeid(*cppSelf).name();
pyOut = Shiboken::Object::newObject(sbk_type, cppSelf, false, false, typeName);
return pyOut;
@@ -509,7 +509,7 @@ bool registerInternalQtConf()
#if PY_MAJOR_VERSION >= 3
QString::fromWCharArray(Py_GetProgramFullPath());
#else
- // Python 2 unfortunately returns a char* array instead of a wchar*, which means that on
+ // Python 2 unfortunately returns a char * array instead of a wchar *, which means that on
// Windows if the executable path contains unicode characters, the returned path will be
// invalid. We can't use QCoreApplication::applicationFilePath because it requires an
// existing QCoreApplication instance despite being a static method.
diff --git a/sources/pyside2/libpyside/pyside.h b/sources/pyside2/libpyside/pyside.h
index b53048eba..1529d79c9 100644
--- a/sources/pyside2/libpyside/pyside.h
+++ b/sources/pyside2/libpyside/pyside.h
@@ -76,7 +76,7 @@ inline uint hash(const T& value)
* \param kwds key->value dictonary.
* \return True if everything goes well, false with a Python error setted otherwise.
*/
-PYSIDE_API bool fillQtProperties(PyObject* qObj, const QMetaObject* metaObj, PyObject* kwds, const char** blackList, unsigned int blackListSize);
+PYSIDE_API bool fillQtProperties(PyObject *qObj, const QMetaObject *metaObj, PyObject *kwds, const char **blackList, unsigned int blackListSize);
/**
* If the type \p T was registered on Qt meta type system with Q_DECLARE_METATYPE macro, this class will initialize
@@ -99,13 +99,13 @@ template<typename T>
struct initQtMetaType<T, false> {
};
-PYSIDE_DEPRECATED(PYSIDE_API void initDynamicMetaObject(SbkObjectType* type, const QMetaObject* base));
-PYSIDE_API void initDynamicMetaObject(SbkObjectType* type, const QMetaObject* base,
+PYSIDE_DEPRECATED(PYSIDE_API void initDynamicMetaObject(SbkObjectType *type, const QMetaObject *base));
+PYSIDE_API void initDynamicMetaObject(SbkObjectType *type, const QMetaObject *base,
std::size_t cppObjSize);
-PYSIDE_API void initQObjectSubType(SbkObjectType* type, PyObject* args, PyObject* kwds);
+PYSIDE_API void initQObjectSubType(SbkObjectType *type, PyObject *args, PyObject *kwds);
/// Return the size in bytes of a type that inherits QObject.
-PYSIDE_API std::size_t getSizeOfQObject(SbkObjectType* type);
+PYSIDE_API std::size_t getSizeOfQObject(SbkObjectType *type);
typedef void (*CleanupFunction)(void);
@@ -127,7 +127,7 @@ PYSIDE_API void destroyQCoreApplication();
* \param name Name of the argument which the function will try retrieve from MetaData
* \return The Python object which contains the Data obtained in metaObject or the Python attribute related with name
*/
-PYSIDE_API PyObject* getMetaDataFromQObject(QObject* cppSelf, PyObject* self, PyObject* name);
+PYSIDE_API PyObject *getMetaDataFromQObject(QObject *cppSelf, PyObject *self, PyObject *name);
/**
* Check if self inherits from class_name
@@ -135,12 +135,12 @@ PYSIDE_API PyObject* getMetaDataFromQObject(QObject* cppSelf, PyObject* self, Py
* \param class_name strict with the class name
* \return Returns true if self object inherits from class_name, otherwise returns false
*/
-PYSIDE_API bool inherits(PyTypeObject* self, const char* class_name);
+PYSIDE_API bool inherits(PyTypeObject *self, const char *class_name);
-PYSIDE_API void* nextQObjectMemoryAddr();
-PYSIDE_API void setNextQObjectMemoryAddr(void* addr);
+PYSIDE_API void *nextQObjectMemoryAddr();
+PYSIDE_API void setNextQObjectMemoryAddr(void *addr);
-PYSIDE_API PyObject* getWrapperForQObject(QObject* cppSelf, SbkObjectType* sbk_type);
+PYSIDE_API PyObject *getWrapperForQObject(QObject *cppSelf, SbkObjectType *sbk_type);
#ifdef PYSIDE_QML_SUPPORT
// Used by QtQuick module to notify QtQml that custom QtQuick items can be registered.
diff --git a/sources/pyside2/libpyside/pysideclassinfo.cpp b/sources/pyside2/libpyside/pysideclassinfo.cpp
index 4edf0fa91..bf2a1307f 100644
--- a/sources/pyside2/libpyside/pysideclassinfo.cpp
+++ b/sources/pyside2/libpyside/pysideclassinfo.cpp
@@ -51,10 +51,10 @@
extern "C"
{
-static PyObject* classInfoTpNew(PyTypeObject* subtype, PyObject* args, PyObject* kwds);
-static int classInfoTpInit(PyObject*, PyObject*, PyObject*);
-static void classInfoFree(void*);
-static PyObject* classCall(PyObject*, PyObject*, PyObject*);
+static PyObject *classInfoTpNew(PyTypeObject *subtype, PyObject *args, PyObject *kwds);
+static int classInfoTpInit(PyObject *, PyObject *, PyObject *);
+static void classInfoFree(void *);
+static PyObject *classCall(PyObject *, PyObject *, PyObject *);
static PyType_Slot PySideClassInfoType_slots[] = {
{Py_tp_call, (void *)classCall},
@@ -89,8 +89,8 @@ PyObject *classCall(PyObject *self, PyObject *args, PyObject * /* kw */)
return 0;
}
- PySideClassInfo* data = reinterpret_cast<PySideClassInfo*>(self);
- PySideClassInfoPrivate* pData = data->d;
+ PySideClassInfo *data = reinterpret_cast<PySideClassInfo *>(self);
+ PySideClassInfoPrivate *pData = data->d;
if (pData->m_alreadyWrapped) {
PyErr_SetString(PyExc_TypeError, "This instance of ClassInfo() was already used to wrap an object");
@@ -106,7 +106,7 @@ PyObject *classCall(PyObject *self, PyObject *args, PyObject * /* kw */)
return 0;
}
- PyTypeObject *klassType = reinterpret_cast<PyTypeObject*>(klass);
+ PyTypeObject *klassType = reinterpret_cast<PyTypeObject *>(klass);
if (Shiboken::ObjectType::checkType(klassType)) {
if (auto userData = PySide::retrieveTypeUserData(klassType)) {
PySide::MetaObjectBuilder &mo = userData->mo;
@@ -127,7 +127,7 @@ PyObject *classCall(PyObject *self, PyObject *args, PyObject * /* kw */)
static PyObject *classInfoTpNew(PyTypeObject *subtype, PyObject * /* args */, PyObject * /* kwds */)
{
- PySideClassInfo* me = reinterpret_cast<PySideClassInfo*>(subtype->tp_alloc(subtype, 0));
+ PySideClassInfo *me = reinterpret_cast<PySideClassInfo *>(subtype->tp_alloc(subtype, 0));
me->d = new PySideClassInfoPrivate;
me->d->m_alreadyWrapped = false;
@@ -135,18 +135,18 @@ static PyObject *classInfoTpNew(PyTypeObject *subtype, PyObject * /* args */, Py
return reinterpret_cast<PyObject *>(me);
}
-int classInfoTpInit(PyObject* self, PyObject* args, PyObject* kwds)
+int classInfoTpInit(PyObject *self, PyObject *args, PyObject *kwds)
{
if (PyTuple_Check(args) && PyTuple_Size(args) > 0) {
PyErr_Format(PyExc_TypeError, "ClassInfo() takes exactly 0 positional arguments (%zd given)", PyTuple_Size(args));
return -1;
}
- PySideClassInfo* data = reinterpret_cast<PySideClassInfo*>(self);
- PySideClassInfoPrivate* pData = data->d;
+ PySideClassInfo *data = reinterpret_cast<PySideClassInfo *>(self);
+ PySideClassInfoPrivate *pData = data->d;
- PyObject* key;
- PyObject* value;
+ PyObject *key;
+ PyObject *value;
Py_ssize_t pos = 0;
// PyDict_Next causes a segfault if kwds is empty
@@ -166,8 +166,8 @@ int classInfoTpInit(PyObject* self, PyObject* args, PyObject* kwds)
void classInfoFree(void *self)
{
- PyObject* pySelf = reinterpret_cast<PyObject*>(self);
- PySideClassInfo* data = reinterpret_cast<PySideClassInfo*>(self);
+ auto pySelf = reinterpret_cast<PyObject *>(self);
+ auto data = reinterpret_cast<PySideClassInfo *>(self);
delete data->d;
Py_TYPE(pySelf)->tp_base->tp_free(self);
@@ -179,7 +179,7 @@ void classInfoFree(void *self)
namespace PySide { namespace ClassInfo {
-void init(PyObject* module)
+void init(PyObject *module)
{
if (PyType_Ready(PySideClassInfoTypeF()) < 0)
return;
@@ -188,14 +188,14 @@ void init(PyObject* module)
PyModule_AddObject(module, CLASSINFO_CLASS_NAME, reinterpret_cast<PyObject *>(PySideClassInfoTypeF()));
}
-bool checkType(PyObject* pyObj)
+bool checkType(PyObject *pyObj)
{
if (pyObj)
return PyType_IsSubtype(Py_TYPE(pyObj), PySideClassInfoTypeF());
return false;
}
-QMap<QByteArray, QByteArray> getMap(PySideClassInfo* obj)
+QMap<QByteArray, QByteArray> getMap(PySideClassInfo *obj)
{
return obj->d->m_data;
}
diff --git a/sources/pyside2/libpyside/pysidemetafunction.cpp b/sources/pyside2/libpyside/pysidemetafunction.cpp
index 4cdc7ec16..346117201 100644
--- a/sources/pyside2/libpyside/pysidemetafunction.cpp
+++ b/sources/pyside2/libpyside/pysidemetafunction.cpp
@@ -49,13 +49,13 @@ extern "C"
struct PySideMetaFunctionPrivate
{
- QObject* qobject;
+ QObject *qobject;
int methodIndex;
};
//methods
-static void functionFree(void*);
-static PyObject* functionCall(PyObject*, PyObject*, PyObject*);
+static void functionFree(void *);
+static PyObject *functionCall(PyObject *, PyObject *, PyObject *);
static PyType_Slot PySideMetaFunctionType_slots[] = {
{Py_tp_call, (void *)functionCall},
@@ -83,15 +83,15 @@ PyTypeObject *PySideMetaFunctionTypeF(void)
void functionFree(void *self)
{
- PySideMetaFunction* function = reinterpret_cast<PySideMetaFunction*>(self);
+ PySideMetaFunction *function = reinterpret_cast<PySideMetaFunction *>(self);
delete function->d;
}
PyObject *functionCall(PyObject *self, PyObject *args, PyObject * /* kw */)
{
- PySideMetaFunction* function = reinterpret_cast<PySideMetaFunction*>(self);
+ PySideMetaFunction *function = reinterpret_cast<PySideMetaFunction *>(self);
- PyObject* retVal;
+ PyObject *retVal;
if (!PySide::MetaFunction::call(function->d->qobject, function->d->methodIndex, args, &retVal))
return 0;
return retVal;
@@ -101,7 +101,7 @@ PyObject *functionCall(PyObject *self, PyObject *args, PyObject * /* kw */)
namespace PySide { namespace MetaFunction {
-void init(PyObject* module)
+void init(PyObject *module)
{
if (PyType_Ready(PySideMetaFunctionTypeF()) < 0)
return;
@@ -109,7 +109,7 @@ void init(PyObject* module)
PyModule_AddObject(module, "MetaFunction", reinterpret_cast<PyObject *>(PySideMetaFunctionTypeF()));
}
-PySideMetaFunction* newObject(QObject* source, int methodIndex)
+PySideMetaFunction *newObject(QObject *source, int methodIndex)
{
if (methodIndex >= source->metaObject()->methodCount())
return 0;
@@ -117,7 +117,7 @@ PySideMetaFunction* newObject(QObject* source, int methodIndex)
QMetaMethod method = source->metaObject()->method(methodIndex);
if ((method.methodType() == QMetaMethod::Slot) ||
(method.methodType() == QMetaMethod::Method)) {
- PySideMetaFunction* function = PyObject_New(PySideMetaFunction, PySideMetaFunctionTypeF());
+ PySideMetaFunction *function = PyObject_New(PySideMetaFunction, PySideMetaFunctionTypeF());
function->d = new PySideMetaFunctionPrivate();
function->d->qobject = source;
function->d->methodIndex = methodIndex;
@@ -126,7 +126,7 @@ PySideMetaFunction* newObject(QObject* source, int methodIndex)
return 0;
}
-bool call(QObject* self, int methodIndex, PyObject* args, PyObject** retVal)
+bool call(QObject *self, int methodIndex, PyObject *args, PyObject **retVal)
{
QMetaMethod method = self->metaObject()->method(methodIndex);
@@ -150,11 +150,11 @@ bool call(QObject* self, int methodIndex, PyObject* args, PyObject** retVal)
return false;
}
- QVariant* methValues = new QVariant[numArgs];
- void** methArgs = new void*[numArgs];
+ QVariant *methValues = new QVariant[numArgs];
+ void **methArgs = new void *[numArgs];
// Prepare room for return type
- const char* returnType = method.typeName();
+ const char *returnType = method.typeName();
if (returnType && std::strcmp("void", returnType))
argTypes.prepend(returnType);
else
@@ -162,7 +162,7 @@ bool call(QObject* self, int methodIndex, PyObject* args, PyObject** retVal)
int i;
for (i = 0; i < numArgs; ++i) {
- const QByteArray& typeName = argTypes[i];
+ const QByteArray &typeName = argTypes.at(i);
// This must happen only when the method hasn't return type.
if (typeName.isEmpty()) {
methArgs[i] = 0;
@@ -204,7 +204,7 @@ bool call(QObject* self, int methodIndex, PyObject* args, PyObject** retVal)
if (retVal) {
if (methArgs[0]) {
- static SbkConverter* qVariantTypeConverter = Shiboken::Conversions::getConverter("QVariant");
+ static SbkConverter *qVariantTypeConverter = Shiboken::Conversions::getConverter("QVariant");
Q_ASSERT(qVariantTypeConverter);
*retVal = Shiboken::Conversions::copyToPython(qVariantTypeConverter, &methValues[0]);
} else {
diff --git a/sources/pyside2/libpyside/pysidemetafunction.h b/sources/pyside2/libpyside/pysidemetafunction.h
index 1085ecb5e..f7cc5307b 100644
--- a/sources/pyside2/libpyside/pysidemetafunction.h
+++ b/sources/pyside2/libpyside/pysidemetafunction.h
@@ -54,7 +54,7 @@ extern "C"
struct PYSIDE_API PySideMetaFunction
{
PyObject_HEAD
- PySideMetaFunctionPrivate* d;
+ PySideMetaFunctionPrivate *d;
};
}; //extern "C"
@@ -67,7 +67,7 @@ namespace PySide { namespace MetaFunction {
* @param methodIndex The index of this function on MetaObject
* @return Return a new reference of PySideMetaFunction
**/
-PYSIDE_API PySideMetaFunction* newObject(QObject* obj, int methodIndex);
+PYSIDE_API PySideMetaFunction *newObject(QObject *obj, int methodIndex);
} //namespace MetaFunction
} //namespace PySide
diff --git a/sources/pyside2/libpyside/pysidemetafunction_p.h b/sources/pyside2/libpyside/pysidemetafunction_p.h
index 442e05ea7..c67233857 100644
--- a/sources/pyside2/libpyside/pysidemetafunction_p.h
+++ b/sources/pyside2/libpyside/pysidemetafunction_p.h
@@ -50,11 +50,11 @@ QT_END_NAMESPACE
namespace PySide { namespace MetaFunction {
- void init(PyObject* module);
+ void init(PyObject *module);
/**
* Does a Qt metacall on a QObject
*/
- bool call(QObject* self, int methodIndex, PyObject* args, PyObject** retVal = 0);
+ bool call(QObject *self, int methodIndex, PyObject *args, PyObject **retVal = nullptr);
} //namespace MetaFunction
} //namespace PySide
diff --git a/sources/pyside2/libpyside/pysideproperty.cpp b/sources/pyside2/libpyside/pysideproperty.cpp
index c48a6f882..a2bf5fd2b 100644
--- a/sources/pyside2/libpyside/pysideproperty.cpp
+++ b/sources/pyside2/libpyside/pysideproperty.cpp
@@ -51,16 +51,16 @@
extern "C"
{
-static PyObject* qpropertyTpNew(PyTypeObject* subtype, PyObject* args, PyObject* kwds);
-static int qpropertyTpInit(PyObject*, PyObject*, PyObject*);
-static void qpropertyDeAlloc(PyObject* self);
+static PyObject *qpropertyTpNew(PyTypeObject *subtype, PyObject *args, PyObject *kwds);
+static int qpropertyTpInit(PyObject *, PyObject *, PyObject *);
+static void qpropertyDeAlloc(PyObject *self);
//methods
-static PyObject* qPropertyCall(PyObject*, PyObject*, PyObject*);
-static PyObject* qPropertySetter(PyObject*, PyObject*);
-static PyObject* qPropertyGetter(PyObject*, PyObject*);
-static int qpropertyTraverse(PyObject* self, visitproc visit, void* arg);
-static int qpropertyClear(PyObject* self);
+static PyObject *qPropertyCall(PyObject *, PyObject *, PyObject *);
+static PyObject *qPropertySetter(PyObject *, PyObject *);
+static PyObject *qPropertyGetter(PyObject *, PyObject *);
+static int qpropertyTraverse(PyObject *self, visitproc visit, void *arg);
+static int qpropertyClear(PyObject *self);
static PyMethodDef PySidePropertyMethods[] = {
{"setter", (PyCFunction)qPropertySetter, METH_O, 0},
@@ -98,7 +98,7 @@ PyTypeObject *PySidePropertyTypeF(void)
return type;
}
-static void qpropertyMetaCall(PySideProperty* pp, PyObject* self, QMetaObject::Call call, void** args)
+static void qpropertyMetaCall(PySideProperty *pp, PyObject *self, QMetaObject::Call call, void **args)
{
Shiboken::Conversions::SpecificConverter converter(pp->d->typeName);
Q_ASSERT(converter);
@@ -109,7 +109,7 @@ static void qpropertyMetaCall(PySideProperty* pp, PyObject* self, QMetaObject::C
case QMetaObject::ReadProperty:
{
Shiboken::GilState gil;
- PyObject* value = PySide::Property::getValue(pp, self);
+ PyObject *value = PySide::Property::getValue(pp, self);
if (value) {
converter.toCpp(value, args[0]);
Py_DECREF(value);
@@ -150,16 +150,16 @@ static void qpropertyMetaCall(PySideProperty* pp, PyObject* self, QMetaObject::C
static PyObject *qpropertyTpNew(PyTypeObject *subtype, PyObject * /* args */, PyObject * /* kwds */)
{
- PySideProperty* me = reinterpret_cast<PySideProperty*>(subtype->tp_alloc(subtype, 0));
+ PySideProperty *me = reinterpret_cast<PySideProperty *>(subtype->tp_alloc(subtype, 0));
me->d = new PySidePropertyPrivate;
return reinterpret_cast<PyObject *>(me);
}
-int qpropertyTpInit(PyObject* self, PyObject* args, PyObject* kwds)
+int qpropertyTpInit(PyObject *self, PyObject *args, PyObject *kwds)
{
- PyObject* type = 0;
- PySideProperty* data = reinterpret_cast<PySideProperty*>(self);
- PySidePropertyPrivate* pData = data->d;
+ PyObject *type = nullptr;
+ auto data = reinterpret_cast<PySideProperty *>(self);
+ PySidePropertyPrivate *pData = data->d;
pData->metaCallHandler = &qpropertyMetaCall;
static const char *kwlist[] = {"type", "fget", "fset", "freset", "fdel", "doc", "notify",
@@ -169,7 +169,7 @@ int qpropertyTpInit(PyObject* self, PyObject* args, PyObject* kwds)
if (!PyArg_ParseTupleAndKeywords(args, kwds,
"O|OOOOsObbbbbb:QtCore.QProperty",
- const_cast<char**>(kwlist),
+ const_cast<char **>(kwlist),
/*OO*/ &type, &(pData->fget),
/*OOO*/ &(pData->fset), &(pData->freset), &(pData->fdel),
/*s*/ &doc,
@@ -208,7 +208,7 @@ int qpropertyTpInit(PyObject* self, PyObject* args, PyObject* kwds)
return -1;
}
-void qpropertyDeAlloc(PyObject* self)
+void qpropertyDeAlloc(PyObject *self)
{
qpropertyClear(self);
Py_TYPE(self)->tp_free(self);
@@ -218,8 +218,8 @@ PyObject *qPropertyCall(PyObject *self, PyObject *args, PyObject * /* kw */)
{
PyObject *callback = PyTuple_GetItem(args, 0);
if (PyFunction_Check(callback)) {
- PySideProperty *prop = reinterpret_cast<PySideProperty*>(self);
- PySidePropertyPrivate* pData = prop->d;
+ auto prop = reinterpret_cast<PySideProperty *>(self);
+ PySidePropertyPrivate *pData = prop->d;
Py_INCREF(callback);
pData->fget = callback;
@@ -231,11 +231,11 @@ PyObject *qPropertyCall(PyObject *self, PyObject *args, PyObject * /* kw */)
return nullptr;
}
-PyObject* qPropertySetter(PyObject* self, PyObject* callback)
+PyObject *qPropertySetter(PyObject *self, PyObject *callback)
{
if (PyFunction_Check(callback)) {
- PySideProperty *prop = reinterpret_cast<PySideProperty*>(self);
- PySidePropertyPrivate* pData = prop->d;
+ PySideProperty *prop = reinterpret_cast<PySideProperty *>(self);
+ PySidePropertyPrivate *pData = prop->d;
Py_INCREF(callback);
pData->fset = callback;
@@ -247,11 +247,11 @@ PyObject* qPropertySetter(PyObject* self, PyObject* callback)
return nullptr;
}
-PyObject* qPropertyGetter(PyObject* self, PyObject* callback)
+PyObject *qPropertyGetter(PyObject *self, PyObject *callback)
{
if (PyFunction_Check(callback)) {
- PySideProperty *prop = reinterpret_cast<PySideProperty*>(self);
- PySidePropertyPrivate* pData = prop->d;
+ PySideProperty *prop = reinterpret_cast<PySideProperty *>(self);
+ PySidePropertyPrivate *pData = prop->d;
Py_INCREF(callback);
pData->fget = callback;
@@ -263,9 +263,9 @@ PyObject* qPropertyGetter(PyObject* self, PyObject* callback)
return nullptr;
}
-static int qpropertyTraverse(PyObject* self, visitproc visit, void* arg)
+static int qpropertyTraverse(PyObject *self, visitproc visit, void *arg)
{
- PySidePropertyPrivate* data = reinterpret_cast<PySideProperty*>(self)->d;
+ PySidePropertyPrivate *data = reinterpret_cast<PySideProperty *>(self)->d;
if (!data)
return 0;
@@ -277,9 +277,9 @@ static int qpropertyTraverse(PyObject* self, visitproc visit, void* arg)
return 0;
}
-static int qpropertyClear(PyObject* self)
+static int qpropertyClear(PyObject *self)
{
- PySidePropertyPrivate* data = reinterpret_cast<PySideProperty*>(self)->d;
+ PySidePropertyPrivate *data = reinterpret_cast<PySideProperty *>(self)->d;
if (!data)
return 0;
@@ -291,7 +291,7 @@ static int qpropertyClear(PyObject* self)
delete data;
- reinterpret_cast<PySideProperty*>(self)->d = 0;
+ reinterpret_cast<PySideProperty *>(self)->d = nullptr;
return 0;
}
@@ -299,16 +299,16 @@ static int qpropertyClear(PyObject* self)
namespace {
-static PyObject* getFromType(PyTypeObject* type, PyObject* name)
+static PyObject *getFromType(PyTypeObject *type, PyObject *name)
{
- PyObject* attr = 0;
+ PyObject *attr = nullptr;
attr = PyDict_GetItem(type->tp_dict, name);
if (!attr) {
- PyObject* bases = type->tp_bases;
+ PyObject *bases = type->tp_bases;
int size = PyTuple_GET_SIZE(bases);
for(int i=0; i < size; i++) {
- PyObject* base = PyTuple_GET_ITEM(bases, i);
- attr = getFromType(reinterpret_cast<PyTypeObject*>(base), name);
+ PyObject *base = PyTuple_GET_ITEM(bases, i);
+ attr = getFromType(reinterpret_cast<PyTypeObject *>(base), name);
if (attr)
return attr;
}
@@ -321,7 +321,7 @@ static PyObject* getFromType(PyTypeObject* type, PyObject* name)
namespace PySide { namespace Property {
-void init(PyObject* module)
+void init(PyObject *module)
{
if (PyType_Ready(PySidePropertyTypeF()) < 0)
return;
@@ -330,7 +330,7 @@ void init(PyObject* module)
PyModule_AddObject(module, QPROPERTY_CLASS_NAME, reinterpret_cast<PyObject *>(PySidePropertyTypeF()));
}
-bool checkType(PyObject* pyObj)
+bool checkType(PyObject *pyObj)
{
if (pyObj) {
return PyType_IsSubtype(Py_TYPE(pyObj), PySidePropertyTypeF());
@@ -338,14 +338,14 @@ bool checkType(PyObject* pyObj)
return false;
}
-bool isPropertyType(PyObject* pyObj)
+bool isPropertyType(PyObject *pyObj)
{
return checkType(pyObj);
}
-int setValue(PySideProperty* self, PyObject* source, PyObject* value)
+int setValue(PySideProperty *self, PyObject *source, PyObject *value)
{
- PyObject* fset = self->d->fset;
+ PyObject *fset = self->d->fset;
if (fset) {
Shiboken::AutoDecRef args(PyTuple_New(2));
PyTuple_SET_ITEM(args, 0, source);
@@ -360,9 +360,9 @@ int setValue(PySideProperty* self, PyObject* source, PyObject* value)
return -1;
}
-PyObject* getValue(PySideProperty* self, PyObject* source)
+PyObject *getValue(PySideProperty *self, PyObject *source)
{
- PyObject* fget = self->d->fget;
+ PyObject *fget = self->d->fget;
if (fget) {
Shiboken::AutoDecRef args(PyTuple_New(1));
Py_INCREF(source);
@@ -372,9 +372,9 @@ PyObject* getValue(PySideProperty* self, PyObject* source)
return 0;
}
-int reset(PySideProperty* self, PyObject* source)
+int reset(PySideProperty *self, PyObject *source)
{
- PyObject* freset = self->d->freset;
+ PyObject *freset = self->d->freset;
if (freset) {
Shiboken::AutoDecRef args(PyTuple_New(1));
Py_INCREF(source);
@@ -385,25 +385,24 @@ int reset(PySideProperty* self, PyObject* source)
return -1;
}
-const char* getTypeName(const PySideProperty* self)
+const char *getTypeName(const PySideProperty *self)
{
return self->d->typeName;
}
-PySideProperty* getObject(PyObject* source, PyObject* name)
+PySideProperty *getObject(PyObject *source, PyObject *name)
{
- PyObject* attr = 0;
+ PyObject *attr = nullptr;
if (Shiboken::Object::isUserType(source)) {
- PyObject* dict = reinterpret_cast<SbkObject*>(source)->ob_dict;
- if (dict)
+ if (auto dict = reinterpret_cast<SbkObject *>(source)->ob_dict)
attr = PyDict_GetItem(dict, name);
}
attr = getFromType(Py_TYPE(source), name);
if (attr && checkType(attr)) {
Py_INCREF(attr);
- return reinterpret_cast<PySideProperty*>(attr);
+ return reinterpret_cast<PySideProperty *>(attr);
}
if (!attr)
@@ -417,50 +416,50 @@ bool isReadable(const PySideProperty * /* self */)
return true;
}
-bool isWritable(const PySideProperty* self)
+bool isWritable(const PySideProperty *self)
{
return (self->d->fset != 0);
}
-bool hasReset(const PySideProperty* self)
+bool hasReset(const PySideProperty *self)
{
return (self->d->freset != 0);
}
-bool isDesignable(const PySideProperty* self)
+bool isDesignable(const PySideProperty *self)
{
return self->d->designable;
}
-bool isScriptable(const PySideProperty* self)
+bool isScriptable(const PySideProperty *self)
{
return self->d->scriptable;
}
-bool isStored(const PySideProperty* self)
+bool isStored(const PySideProperty *self)
{
return self->d->stored;
}
-bool isUser(const PySideProperty* self)
+bool isUser(const PySideProperty *self)
{
return self->d->user;
}
-bool isConstant(const PySideProperty* self)
+bool isConstant(const PySideProperty *self)
{
return self->d->constant;
}
-bool isFinal(const PySideProperty* self)
+bool isFinal(const PySideProperty *self)
{
return self->d->final;
}
-const char* getNotifyName(PySideProperty* self)
+const char *getNotifyName(PySideProperty *self)
{
if (self->d->notifySignature.isEmpty()) {
- PyObject* str = PyObject_Str(self->d->notify);
+ PyObject *str = PyObject_Str(self->d->notify);
self->d->notifySignature = Shiboken::String::toCString(str);
Py_DECREF(str);
}
@@ -469,22 +468,22 @@ const char* getNotifyName(PySideProperty* self)
? nullptr : self->d->notifySignature.constData();
}
-void setMetaCallHandler(PySideProperty* self, MetaCallHandler handler)
+void setMetaCallHandler(PySideProperty *self, MetaCallHandler handler)
{
self->d->metaCallHandler = handler;
}
-void setTypeName(PySideProperty* self, const char* typeName)
+void setTypeName(PySideProperty *self, const char *typeName)
{
self->d->typeName = typeName;
}
-void setUserData(PySideProperty* self, void* data)
+void setUserData(PySideProperty *self, void *data)
{
self->d->userData = data;
}
-void* userData(PySideProperty* self)
+void *userData(PySideProperty *self)
{
return self->d->userData;
}
diff --git a/sources/pyside2/libpyside/pysideqflags.cpp b/sources/pyside2/libpyside/pysideqflags.cpp
index cb57031b0..fd0ed005f 100644
--- a/sources/pyside2/libpyside/pysideqflags.cpp
+++ b/sources/pyside2/libpyside/pysideqflags.cpp
@@ -47,8 +47,8 @@ extern "C" {
struct PySideQFlagsTypePrivate
{
- SbkConverter** converterPtr;
- SbkConverter* converter;
+ SbkConverter **converterPtr;
+ SbkConverter *converter;
};
/**
* Type of all QFlags
@@ -58,13 +58,13 @@ extern "C" {
PyTypeObject type;
};
- #define PYSIDE_QFLAGS(X) reinterpret_cast<PySideQFlagsObject*>(X)
+ #define PYSIDE_QFLAGS(X) reinterpret_cast<PySideQFlagsObject *>(X)
PyObject *PySideQFlagsNew(PyTypeObject *type, PyObject *args, PyObject * /* kwds */)
{
long val = 0;
if (PyTuple_GET_SIZE(args)) {
- PyObject* arg = PyTuple_GET_ITEM(args, 0);
+ PyObject *arg = PyTuple_GET_ITEM(args, 0);
if (Shiboken::isShibokenEnum(arg)) {// faster call
val = Shiboken::Enum::getValue(arg);
} else if (PyNumber_Check(arg)) {
@@ -75,18 +75,18 @@ extern "C" {
return 0;
}
}
- PySideQFlagsObject* self = PyObject_New(PySideQFlagsObject, type);
+ PySideQFlagsObject *self = PyObject_New(PySideQFlagsObject, type);
self->ob_value = val;
- return reinterpret_cast<PyObject*>(self);
+ return reinterpret_cast<PyObject *>(self);
}
- static long getNumberValue(PyObject* v)
+ static long getNumberValue(PyObject *v)
{
Shiboken::AutoDecRef number(PyNumber_Long(v));
return PyLong_AsLong(number);
}
- PyObject* PySideQFlagsRichCompare(PyObject* self, PyObject* other, int op)
+ PyObject *PySideQFlagsRichCompare(PyObject *self, PyObject *other, int op)
{
int result = 0;
if (!PyNumber_Check(other)) {
@@ -163,7 +163,7 @@ namespace QFlags
SbkNewQFlagsType_slots,
};
- PyTypeObject *create(const char* name, PyType_Slot numberMethods[])
+ PyTypeObject *create(const char *name, PyType_Slot numberMethods[])
{
char qualname[200];
// PYSIDE-747: Here we insert now the full class name.
@@ -183,7 +183,7 @@ namespace QFlags
PyTypeObject *type = (PyTypeObject *)PyType_FromSpec(newspec);
Py_TYPE(type) = &PyType_Type;
- PySideQFlagsType* flagsType = reinterpret_cast<PySideQFlagsType*>(type);
+ PySideQFlagsType *flagsType = reinterpret_cast<PySideQFlagsType *>(type);
PepType_PFTP(flagsType)->converterPtr = &PepType_PFTP(flagsType)->converter;
if (PyType_Ready(type) < 0)
@@ -192,14 +192,14 @@ namespace QFlags
return type;
}
- PySideQFlagsObject* newObject(long value, PyTypeObject* type)
+ PySideQFlagsObject *newObject(long value, PyTypeObject *type)
{
- PySideQFlagsObject* qflags = PyObject_New(PySideQFlagsObject, type);
+ PySideQFlagsObject *qflags = PyObject_New(PySideQFlagsObject, type);
qflags->ob_value = value;
return qflags;
}
- long getValue(PySideQFlagsObject* self)
+ long getValue(PySideQFlagsObject *self)
{
return self->ob_value;
}
diff --git a/sources/pyside2/libpyside/pysidesignal.cpp b/sources/pyside2/libpyside/pysidesignal.cpp
index 0f1993e79..169028f0c 100644
--- a/sources/pyside2/libpyside/pysidesignal.cpp
+++ b/sources/pyside2/libpyside/pysidesignal.cpp
@@ -71,11 +71,11 @@ namespace Signal {
QMetaMethod::Attributes m_attributes = QMetaMethod::Compatibility;
};
- static QByteArray buildSignature(const QByteArray &, const QByteArray &);
- static void appendSignature(PySideSignal*, const SignalSignature &);
- static void instanceInitialize(PySideSignalInstance*, PyObject*, PySideSignal*, PyObject*, int);
- static QByteArray parseSignature(PyObject *);
- static PyObject* buildQtCompatible(const QByteArray &);
+ static QByteArray buildSignature(const QByteArray &, const QByteArray &);
+ static void appendSignature(PySideSignal *, const SignalSignature &);
+ static void instanceInitialize(PySideSignalInstance *, PyObject *, PySideSignal *, PyObject *, int);
+ static QByteArray parseSignature(PyObject *);
+ static PyObject *buildQtCompatible(const QByteArray &);
}
}
@@ -83,22 +83,22 @@ extern "C"
{
// Signal methods
-static int signalTpInit(PyObject*, PyObject*, PyObject*);
-static void signalFree(void*);
-static void signalInstanceFree(void*);
-static PyObject* signalGetItem(PyObject* self, PyObject* key);
-static PyObject* signalToString(PyObject* self);
+static int signalTpInit(PyObject *, PyObject *, PyObject *);
+static void signalFree(void *);
+static void signalInstanceFree(void *);
+static PyObject *signalGetItem(PyObject *self, PyObject *key);
+static PyObject *signalToString(PyObject *self);
// Signal Instance methods
-static PyObject* signalInstanceConnect(PyObject*, PyObject*, PyObject*);
-static PyObject* signalInstanceDisconnect(PyObject*, PyObject*);
-static PyObject* signalInstanceEmit(PyObject*, PyObject*);
-static PyObject* signalInstanceGetItem(PyObject*, PyObject*);
+static PyObject *signalInstanceConnect(PyObject *, PyObject *, PyObject *);
+static PyObject *signalInstanceDisconnect(PyObject *, PyObject *);
+static PyObject *signalInstanceEmit(PyObject *, PyObject *);
+static PyObject *signalInstanceGetItem(PyObject *, PyObject *);
-static PyObject* signalInstanceCall(PyObject* self, PyObject* args, PyObject* kw);
-static PyObject* signalCall(PyObject*, PyObject*, PyObject*);
+static PyObject *signalInstanceCall(PyObject *self, PyObject *args, PyObject *kw);
+static PyObject *signalCall(PyObject *, PyObject *, PyObject *);
-static PyObject* metaSignalCheck(PyObject*, PyObject*);
+static PyObject *metaSignalCheck(PyObject *, PyObject *);
static PyMethodDef Signal_methods[] = {
@@ -200,28 +200,28 @@ PyTypeObject *PySideSignalInstanceTypeF(void)
return type;
}
-int signalTpInit(PyObject* self, PyObject* args, PyObject* kwds)
+int signalTpInit(PyObject *self, PyObject *args, PyObject *kwds)
{
- static PyObject* emptyTuple = 0;
- static const char* kwlist[] = {"name", 0};
- char* argName = 0;
+ static PyObject *emptyTuple = nullptr;
+ static const char *kwlist[] = {"name", nullptr};
+ char *argName = nullptr;
if (emptyTuple == 0)
emptyTuple = PyTuple_New(0);
if (!PyArg_ParseTupleAndKeywords(emptyTuple, kwds,
- "|s:QtCore." SIGNAL_CLASS_NAME, const_cast<char**>(kwlist), &argName))
+ "|s:QtCore." SIGNAL_CLASS_NAME, const_cast<char **>(kwlist), &argName))
return 0;
bool tupledArgs = false;
- PySideSignal* data = reinterpret_cast<PySideSignal*>(self);
+ PySideSignal *data = reinterpret_cast<PySideSignal *>(self);
if (!data->data)
data->data = new PySideSignalData;
if (argName)
data->data->signalName = argName;
for (Py_ssize_t i = 0, i_max = PyTuple_Size(args); i < i_max; i++) {
- PyObject* arg = PyTuple_GET_ITEM(args, i);
+ PyObject *arg = PyTuple_GET_ITEM(args, i);
if (PySequence_Check(arg) && !Shiboken::String::check(arg)) {
tupledArgs = true;
const auto sig = PySide::Signal::parseSignature(arg);
@@ -241,10 +241,10 @@ int signalTpInit(PyObject* self, PyObject* args, PyObject* kwds)
return 1;
}
-void signalFree(void* self)
+void signalFree(void *self)
{
- PyObject* pySelf = reinterpret_cast<PyObject*>(self);
- PySideSignal* data = reinterpret_cast<PySideSignal*>(self);
+ auto pySelf = reinterpret_cast<PyObject *>(self);
+ auto data = reinterpret_cast<PySideSignal *>(self);
delete data->data;
data->data = nullptr;
Py_XDECREF(data->homonymousMethod);
@@ -253,9 +253,9 @@ void signalFree(void* self)
Py_TYPE(pySelf)->tp_base->tp_free(self);
}
-PyObject* signalGetItem(PyObject* self, PyObject* key)
+PyObject *signalGetItem(PyObject *self, PyObject *key)
{
- PySideSignal* data = reinterpret_cast<PySideSignal*>(self);
+ auto data = reinterpret_cast<PySideSignal *>(self);
QByteArray sigKey;
if (key) {
sigKey = PySide::Signal::parseSignature(key);
@@ -268,17 +268,17 @@ PyObject* signalGetItem(PyObject* self, PyObject* key)
}
-PyObject* signalToString(PyObject* self)
+PyObject *signalToString(PyObject *self)
{
return signalGetItem(self, 0);
}
-void signalInstanceFree(void* self)
+void signalInstanceFree(void *self)
{
- PyObject* pySelf = reinterpret_cast<PyObject*>(self);
- PySideSignalInstance* data = reinterpret_cast<PySideSignalInstance*>(self);
+ auto pySelf = reinterpret_cast<PyObject *>(self);
+ auto data = reinterpret_cast<PySideSignalInstance *>(self);
- PySideSignalInstancePrivate* dataPvt = data->d;
+ PySideSignalInstancePrivate *dataPvt = data->d;
Py_XDECREF(dataPvt->homonymousMethod);
@@ -291,27 +291,27 @@ void signalInstanceFree(void* self)
Py_TYPE(pySelf)->tp_base->tp_free(self);
}
-PyObject* signalInstanceConnect(PyObject* self, PyObject* args, PyObject* kwds)
+PyObject *signalInstanceConnect(PyObject *self, PyObject *args, PyObject *kwds)
{
- PyObject* slot = 0;
- PyObject* type = 0;
- static const char* kwlist[] = {"slot", "type", 0};
+ PyObject *slot = nullptr;
+ PyObject *type = nullptr;
+ static const char *kwlist[] = {"slot", "type", nullptr};
if (!PyArg_ParseTupleAndKeywords(args, kwds,
- "O|O:" SIGNAL_INSTANCE_NAME, const_cast<char**>(kwlist), &slot, &type))
+ "O|O:" SIGNAL_INSTANCE_NAME, const_cast<char **>(kwlist), &slot, &type))
return 0;
- PySideSignalInstance* source = reinterpret_cast<PySideSignalInstance*>(self);
+ PySideSignalInstance *source = reinterpret_cast<PySideSignalInstance *>(self);
Shiboken::AutoDecRef pyArgs(PyList_New(0));
bool match = false;
if (Py_TYPE(slot) == PySideSignalInstanceTypeF()) {
- PySideSignalInstance* sourceWalk = source;
- PySideSignalInstance* targetWalk;
+ PySideSignalInstance *sourceWalk = source;
+ PySideSignalInstance *targetWalk;
//find best match
while (sourceWalk && !match) {
- targetWalk = reinterpret_cast<PySideSignalInstance*>(slot);
+ targetWalk = reinterpret_cast<PySideSignalInstance *>(slot);
while (targetWalk && !match) {
if (QMetaObject::checkConnectArgs(sourceWalk->d->signature, targetWalk->d->signature)) {
PyList_Append(pyArgs, sourceWalk->d->source);
@@ -324,9 +324,9 @@ PyObject* signalInstanceConnect(PyObject* self, PyObject* args, PyObject* kwds)
match = true;
}
- targetWalk = reinterpret_cast<PySideSignalInstance*>(targetWalk->d->next);
+ targetWalk = reinterpret_cast<PySideSignalInstance *>(targetWalk->d->next);
}
- sourceWalk = reinterpret_cast<PySideSignalInstance*>(sourceWalk->d->next);
+ sourceWalk = reinterpret_cast<PySideSignalInstance *>(sourceWalk->d->next);
}
} else {
// Check signature of the slot (method or function) to match signal
@@ -399,7 +399,7 @@ PyObject* signalInstanceConnect(PyObject* self, PyObject* args, PyObject* kwds)
PyErr_SetString(PyExc_RuntimeError, "method 'connect' vanished!");
return 0;
}
- PyObject* result = PyObject_CallObject(pyMethod, tupleArgs);
+ PyObject *result = PyObject_CallObject(pyMethod, tupleArgs);
if (result == Py_True || result == Py_False)
return result;
Py_XDECREF(result);
@@ -415,9 +415,9 @@ int argCountInSignature(const char *signature)
return QByteArray(signature).count(",") + 1;
}
-PyObject* signalInstanceEmit(PyObject* self, PyObject* args)
+PyObject *signalInstanceEmit(PyObject *self, PyObject *args)
{
- PySideSignalInstance* source = reinterpret_cast<PySideSignalInstance*>(self);
+ PySideSignalInstance *source = reinterpret_cast<PySideSignalInstance *>(self);
Shiboken::AutoDecRef pyArgs(PyList_New(0));
int numArgsGiven = PySequence_Fast_GET_SIZE(args);
@@ -453,15 +453,15 @@ PyObject* signalInstanceEmit(PyObject* self, PyObject* args)
return PyObject_CallObject(pyMethod, tupleArgs);
}
-PyObject* signalInstanceGetItem(PyObject* self, PyObject* key)
+PyObject *signalInstanceGetItem(PyObject *self, PyObject *key)
{
- PySideSignalInstance* data = reinterpret_cast<PySideSignalInstance*>(self);
+ auto data = reinterpret_cast<PySideSignalInstance *>(self);
const auto sigName = data->d->signalName;
const auto sigKey = PySide::Signal::parseSignature(key);
const auto sig = PySide::Signal::buildSignature(sigName, sigKey);
while (data) {
if (data->d->signature == sig) {
- PyObject* result = reinterpret_cast<PyObject*>(data);
+ PyObject *result = reinterpret_cast<PyObject *>(data);
Py_INCREF(result);
return result;
}
@@ -473,12 +473,12 @@ PyObject* signalInstanceGetItem(PyObject* self, PyObject* key)
return 0;
}
-PyObject* signalInstanceDisconnect(PyObject* self, PyObject* args)
+PyObject *signalInstanceDisconnect(PyObject *self, PyObject *args)
{
- PySideSignalInstance* source = reinterpret_cast<PySideSignalInstance*>(self);
+ auto source = reinterpret_cast<PySideSignalInstance *>(self);
Shiboken::AutoDecRef pyArgs(PyList_New(0));
- PyObject* slot;
+ PyObject *slot;
if (PyTuple_Check(args) && PyTuple_GET_SIZE(args))
slot = PyTuple_GET_ITEM(args, 0);
else
@@ -486,7 +486,7 @@ PyObject* signalInstanceDisconnect(PyObject* self, PyObject* args)
bool match = false;
if (Py_TYPE(slot) == PySideSignalInstanceTypeF()) {
- PySideSignalInstance* target = reinterpret_cast<PySideSignalInstance*>(slot);
+ PySideSignalInstance *target = reinterpret_cast<PySideSignalInstance *>(slot);
if (QMetaObject::checkConnectArgs(source->d->signature, target->d->signature)) {
PyList_Append(pyArgs, source->d->source);
Shiboken::AutoDecRef source_signature(PySide::Signal::buildQtCompatible(source->d->signature));
@@ -513,7 +513,7 @@ PyObject* signalInstanceDisconnect(PyObject* self, PyObject* args)
if (match) {
Shiboken::AutoDecRef tupleArgs(PyList_AsTuple(pyArgs));
Shiboken::AutoDecRef pyMethod(PyObject_GetAttrString(source->d->source, "disconnect"));
- PyObject* result = PyObject_CallObject(pyMethod, tupleArgs);
+ PyObject *result = PyObject_CallObject(pyMethod, tupleArgs);
if (!result || result == Py_True)
return result;
else
@@ -525,9 +525,9 @@ PyObject* signalInstanceDisconnect(PyObject* self, PyObject* args)
return 0;
}
-PyObject* signalCall(PyObject* self, PyObject* args, PyObject* kw)
+PyObject *signalCall(PyObject *self, PyObject *args, PyObject *kw)
{
- PySideSignal* signal = reinterpret_cast<PySideSignal*>(self);
+ auto signal = reinterpret_cast<PySideSignal *>(self);
// Native C++ signals can't be called like functions, thus we throw an exception.
// The only way calling a signal can succeed (the Python equivalent of C++'s operator() )
@@ -553,9 +553,9 @@ PyObject* signalCall(PyObject* self, PyObject* args, PyObject* kw)
return callFunc(homonymousMethod, args, kw);
}
-PyObject* signalInstanceCall(PyObject* self, PyObject* args, PyObject* kw)
+PyObject *signalInstanceCall(PyObject *self, PyObject *args, PyObject *kw)
{
- PySideSignalInstance* PySideSignal = reinterpret_cast<PySideSignalInstance*>(self);
+ auto PySideSignal = reinterpret_cast<PySideSignalInstance *>(self);
if (!PySideSignal->d->homonymousMethod) {
PyErr_SetString(PyExc_TypeError, "native Qt signal is not callable");
return 0;
@@ -566,7 +566,7 @@ PyObject* signalInstanceCall(PyObject* self, PyObject* args, PyObject* kw)
return PyCFunction_Call(homonymousMethod, args, kw);
}
-static PyObject *metaSignalCheck(PyObject * /* klass */, PyObject* args)
+static PyObject *metaSignalCheck(PyObject * /* klass */, PyObject *args)
{
if (PyType_IsSubtype(Py_TYPE(args), PySideSignalInstanceTypeF()))
Py_RETURN_TRUE;
@@ -579,7 +579,7 @@ static PyObject *metaSignalCheck(PyObject * /* klass */, PyObject* args)
namespace PySide {
namespace Signal {
-void init(PyObject* module)
+void init(PyObject *module)
{
if (PyType_Ready(PySideSignalMetaTypeF()) < 0)
return;
@@ -596,25 +596,25 @@ void init(PyObject* module)
Py_INCREF(PySideSignalInstanceTypeF());
}
-bool checkType(PyObject* pyObj)
+bool checkType(PyObject *pyObj)
{
if (pyObj)
return PyType_IsSubtype(Py_TYPE(pyObj), PySideSignalTypeF());
return false;
}
-void updateSourceObject(PyObject* source)
+void updateSourceObject(PyObject *source)
{
- PyTypeObject* objType = reinterpret_cast<PyTypeObject*>(PyObject_Type(source));
+ PyTypeObject *objType = reinterpret_cast<PyTypeObject *>(PyObject_Type(source));
Py_ssize_t pos = 0;
- PyObject* value;
- PyObject* key;
+ PyObject *value;
+ PyObject *key;
while (PyDict_Next(objType->tp_dict, &pos, &key, &value)) {
if (PyObject_TypeCheck(value, PySideSignalTypeF())) {
Shiboken::AutoDecRef signalInstance(reinterpret_cast<PyObject *>(PyObject_New(PySideSignalInstance, PySideSignalInstanceTypeF())));
- instanceInitialize(signalInstance.cast<PySideSignalInstance*>(), key, reinterpret_cast<PySideSignal*>(value), source, 0);
+ instanceInitialize(signalInstance.cast<PySideSignalInstance *>(), key, reinterpret_cast<PySideSignal *>(value), source, 0);
PyObject_SetAttr(source, key, signalInstance);
}
}
@@ -625,13 +625,13 @@ void updateSourceObject(PyObject* source)
QByteArray getTypeName(PyObject *type)
{
if (PyType_Check(type)) {
- if (PyType_IsSubtype(reinterpret_cast<PyTypeObject*>(type),
- reinterpret_cast<PyTypeObject*>(SbkObject_TypeF()))) {
- SbkObjectType* objType = reinterpret_cast<SbkObjectType*>(type);
+ if (PyType_IsSubtype(reinterpret_cast<PyTypeObject *>(type),
+ reinterpret_cast<PyTypeObject *>(SbkObject_TypeF()))) {
+ auto objType = reinterpret_cast<SbkObjectType *>(type);
return Shiboken::ObjectType::getOriginalName(objType);
}
// Translate python types to Qt names
- PyTypeObject* objType = reinterpret_cast<PyTypeObject*>(type);
+ auto objType = reinterpret_cast<PyTypeObject *>(type);
if (Shiboken::String::checkType(objType))
return QByteArrayLiteral("QString");
if (objType == &PyInt_Type)
@@ -662,7 +662,7 @@ QByteArray buildSignature(const QByteArray &name, const QByteArray &signature)
return QMetaObject::normalizedSignature(name + '(' + signature + ')');
}
-QByteArray parseSignature(PyObject* args)
+QByteArray parseSignature(PyObject *args)
{
if (args && (Shiboken::String::check(args) || !PySequence_Check(args)))
return getTypeName(args);
@@ -680,25 +680,25 @@ QByteArray parseSignature(PyObject* args)
return signature;
}
-void appendSignature(PySideSignal* self, const SignalSignature &signature)
+void appendSignature(PySideSignal *self, const SignalSignature &signature)
{
self->data->signatures.append({signature.m_parameterTypes, signature.m_attributes});
}
-PySideSignalInstance* initialize(PySideSignal* self, PyObject* name, PyObject* object)
+PySideSignalInstance *initialize(PySideSignal *self, PyObject *name, PyObject *object)
{
- PySideSignalInstance* instance = PyObject_New(PySideSignalInstance, PySideSignalInstanceTypeF());
- SbkObject* sbkObj = reinterpret_cast<SbkObject*>(object);
+ PySideSignalInstance *instance = PyObject_New(PySideSignalInstance, PySideSignalInstanceTypeF());
+ auto sbkObj = reinterpret_cast<SbkObject *>(object);
if (!Shiboken::Object::wasCreatedByPython(sbkObj))
Py_INCREF(object); // PYSIDE-79: this flag was crucial for a wrapper call.
instanceInitialize(instance, name, self, object, 0);
return instance;
}
-void instanceInitialize(PySideSignalInstance* self, PyObject* name, PySideSignal* data, PyObject* source, int index)
+void instanceInitialize(PySideSignalInstance *self, PyObject *name, PySideSignal *data, PyObject *source, int index)
{
self->d = new PySideSignalInstancePrivate;
- PySideSignalInstancePrivate* selfPvt = self->d;
+ PySideSignalInstancePrivate *selfPvt = self->d;
selfPvt->next = nullptr;
if (data->data->signalName.isEmpty())
data->data->signalName = Shiboken::String::toCString(name);
@@ -721,7 +721,7 @@ void instanceInitialize(PySideSignalInstance* self, PyObject* name, PySideSignal
}
}
-bool connect(PyObject* source, const char* signal, PyObject* callback)
+bool connect(PyObject *source, const char *signal, PyObject *callback)
{
Shiboken::AutoDecRef pyMethod(PyObject_GetAttrString(source, "connect"));
if (pyMethod.isNull())
@@ -729,7 +729,7 @@ bool connect(PyObject* source, const char* signal, PyObject* callback)
Shiboken::AutoDecRef pySignature(Shiboken::String::fromCString(signal));
Shiboken::AutoDecRef pyArgs(PyTuple_Pack(3, source, pySignature.object(), callback));
- PyObject* result = PyObject_CallObject(pyMethod, pyArgs);
+ PyObject *result = PyObject_CallObject(pyMethod, pyArgs);
if (result == Py_False) {
PyErr_Format(PyExc_RuntimeError, "Failed to connect signal %s, to python callable object.", signal);
Py_DECREF(result);
@@ -738,12 +738,12 @@ bool connect(PyObject* source, const char* signal, PyObject* callback)
return result;
}
-PySideSignalInstance* newObjectFromMethod(PyObject* source, const QList<QMetaMethod>& methodList)
+PySideSignalInstance *newObjectFromMethod(PyObject *source, const QList<QMetaMethod>& methodList)
{
- PySideSignalInstance* root = 0;
- PySideSignalInstance* previous = 0;
+ PySideSignalInstance *root = nullptr;
+ PySideSignalInstance *previous = nullptr;
for (const QMetaMethod &m : methodList) {
- PySideSignalInstance* item = PyObject_New(PySideSignalInstance, PySideSignalInstanceTypeF());
+ PySideSignalInstance *item = PyObject_New(PySideSignalInstance, PySideSignalInstanceTypeF());
if (!root)
root = item;
@@ -751,7 +751,7 @@ PySideSignalInstance* newObjectFromMethod(PyObject* source, const QList<QMetaMet
previous->d->next = item;
item->d = new PySideSignalInstancePrivate;
- PySideSignalInstancePrivate* selfPvt = item->d;
+ PySideSignalInstancePrivate *selfPvt = item->d;
selfPvt->source = source;
Py_INCREF(selfPvt->source); // PYSIDE-79: an INCREF is missing.
QByteArray cppName(m.methodSignature());
@@ -766,17 +766,17 @@ PySideSignalInstance* newObjectFromMethod(PyObject* source, const QList<QMetaMet
return root;
}
-PySideSignal* newObject(const char* name, ...)
+PySideSignal *newObject(const char *name, ...)
{
va_list listSignatures;
- char* sig = 0;
- PySideSignal* self = PyObject_New(PySideSignal, PySideSignalTypeF());
+ char *sig = nullptr;
+ PySideSignal *self = PyObject_New(PySideSignal, PySideSignalTypeF());
self->data = new PySideSignalData;
self->data->signalName = name;
self->homonymousMethod = 0;
va_start(listSignatures, name);
- sig = va_arg(listSignatures, char*);
+ sig = va_arg(listSignatures, char *);
while (sig != NULL) {
if (strcmp(sig, "void") == 0)
@@ -784,7 +784,7 @@ PySideSignal* newObject(const char* name, ...)
else
appendSignature(self, SignalSignature(sig));
- sig = va_arg(listSignatures, char*);
+ sig = va_arg(listSignatures, char *);
}
va_end(listSignatures);
@@ -793,7 +793,7 @@ PySideSignal* newObject(const char* name, ...)
}
template<typename T>
-static typename T::value_type join(T t, const char* sep)
+static typename T::value_type join(T t, const char *sep)
{
typename T::value_type res;
if (t.isEmpty())
@@ -812,15 +812,15 @@ static typename T::value_type join(T t, const char* sep)
return res;
}
-static void _addSignalToWrapper(SbkObjectType* wrapperType, const char* signalName, PySideSignal* signal)
+static void _addSignalToWrapper(SbkObjectType *wrapperType, const char *signalName, PySideSignal *signal)
{
- PyObject* typeDict = reinterpret_cast<PyTypeObject *>(wrapperType)->tp_dict;
- PyObject* homonymousMethod;
+ auto typeDict = reinterpret_cast<PyTypeObject *>(wrapperType)->tp_dict;
+ PyObject *homonymousMethod;
if ((homonymousMethod = PyDict_GetItemString(typeDict, signalName))) {
Py_INCREF(homonymousMethod);
signal->homonymousMethod = homonymousMethod;
}
- PyDict_SetItemString(typeDict, signalName, reinterpret_cast<PyObject*>(signal));
+ PyDict_SetItemString(typeDict, signalName, reinterpret_cast<PyObject *>(signal));
}
// This function is used by qStableSort to promote empty signatures
@@ -829,7 +829,7 @@ static bool compareSignals(const SignalSignature &sig1, const SignalSignature &)
return sig1.m_parameterTypes.isEmpty();
}
-void registerSignals(SbkObjectType* pyObj, const QMetaObject* metaObject)
+void registerSignals(SbkObjectType *pyObj, const QMetaObject *metaObject)
{
typedef QHash<QByteArray, QList<SignalSignature> > SignalSigMap;
SignalSigMap signalsFound;
@@ -850,7 +850,7 @@ void registerSignals(SbkObjectType* pyObj, const QMetaObject* metaObject)
SignalSigMap::Iterator it = signalsFound.begin();
SignalSigMap::Iterator end = signalsFound.end();
for (; it != end; ++it) {
- PySideSignal* self = PyObject_New(PySideSignal, PySideSignalTypeF());
+ PySideSignal *self = PyObject_New(PySideSignal, PySideSignalTypeF());
self->data = new PySideSignalData;
self->data->signalName = it.key();
self->homonymousMethod = 0;
@@ -869,28 +869,28 @@ void registerSignals(SbkObjectType* pyObj, const QMetaObject* metaObject)
}
}
-PyObject* buildQtCompatible(const QByteArray &signature)
+PyObject *buildQtCompatible(const QByteArray &signature)
{
const auto ba = QT_SIGNAL_SENTINEL + signature;
return Shiboken::String::fromStringAndSize(ba, ba.size());
}
-void addSignalToWrapper(SbkObjectType* wrapperType, const char* signalName, PySideSignal* signal)
+void addSignalToWrapper(SbkObjectType *wrapperType, const char *signalName, PySideSignal *signal)
{
_addSignalToWrapper(wrapperType, signalName, signal);
}
-PyObject* getObject(PySideSignalInstance* signal)
+PyObject *getObject(PySideSignalInstance *signal)
{
return signal->d->source;
}
-const char* getSignature(PySideSignalInstance* signal)
+const char *getSignature(PySideSignalInstance *signal)
{
return signal->d->signature;
}
-QStringList getArgsFromSignature(const char* signature, bool* isShortCircuit)
+QStringList getArgsFromSignature(const char *signature, bool *isShortCircuit)
{
const QString qsignature = QLatin1String(signature);
QStringList result;
@@ -910,7 +910,7 @@ QStringList getArgsFromSignature(const char* signature, bool* isShortCircuit)
return result;
}
-QString getCallbackSignature(const char* signal, QObject* receiver, PyObject* callback, bool encodeName)
+QString getCallbackSignature(const char *signal, QObject *receiver, PyObject *callback, bool encodeName)
{
QByteArray functionName;
int numArgs = -1;
@@ -919,8 +919,8 @@ QString getCallbackSignature(const char* signal, QObject* receiver, PyObject* ca
bool isFunction = PyFunction_Check(callback);
if (isMethod || isFunction) {
- PyObject* function = isMethod ? PyMethod_GET_FUNCTION(callback) : callback;
- PyCodeObject* objCode = reinterpret_cast<PyCodeObject*>(PyFunction_GET_CODE(function));
+ PyObject *function = isMethod ? PyMethod_GET_FUNCTION(callback) : callback;
+ auto objCode = reinterpret_cast<PyCodeObject *>(PyFunction_GET_CODE(function));
functionName = Shiboken::String::toCString(PepFunction_GetName(function));
useSelf = isMethod;
numArgs = PepCode_GET_FLAGS(objCode) & CO_VARARGS ? -1 : PepCode_GET_ARGCOUNT(objCode);
@@ -932,7 +932,7 @@ QString getCallbackSignature(const char* signal, QObject* receiver, PyObject* ca
if (receiver) {
//Search for signature on metaobject
- const QMetaObject* mo = receiver->metaObject();
+ const QMetaObject *mo = receiver->metaObject();
QByteArray prefix(functionName);
prefix += '(';
for (int i = 0; i < mo->methodCount(); i++) {
@@ -976,12 +976,12 @@ QString getCallbackSignature(const char* signal, QObject* receiver, PyObject* ca
return signature;
}
-bool isQtSignal(const char* signal)
+bool isQtSignal(const char *signal)
{
return (signal && signal[0] == QT_SIGNAL_SENTINEL);
}
-bool checkQtSignal(const char* signal)
+bool checkQtSignal(const char *signal)
{
if (!isQtSignal(signal)) {
PyErr_SetString(PyExc_TypeError, "Use the function PySide2.QtCore.SIGNAL on signals");
@@ -990,11 +990,11 @@ bool checkQtSignal(const char* signal)
return true;
}
-QString codeCallbackName(PyObject* callback, const QString& funcName)
+QString codeCallbackName(PyObject *callback, const QString &funcName)
{
if (PyMethod_Check(callback)) {
- PyObject* self = PyMethod_GET_SELF(callback);
- PyObject* func = PyMethod_GET_FUNCTION(callback);
+ PyObject *self = PyMethod_GET_SELF(callback);
+ PyObject *func = PyMethod_GET_FUNCTION(callback);
return funcName + QString::number(quint64(self), 16) + QString::number(quint64(func), 16);
}
return funcName + QString::number(quint64(callback), 16);
diff --git a/sources/pyside2/libpyside/pysideslot.cpp b/sources/pyside2/libpyside/pysideslot.cpp
index 4104c090d..2cdf32626 100644
--- a/sources/pyside2/libpyside/pysideslot.cpp
+++ b/sources/pyside2/libpyside/pysideslot.cpp
@@ -64,8 +64,8 @@ typedef struct
extern "C"
{
-static int slotTpInit(PyObject*, PyObject*, PyObject*);
-static PyObject* slotCall(PyObject*, PyObject*, PyObject*);
+static int slotTpInit(PyObject *, PyObject *, PyObject *);
+static PyObject *slotCall(PyObject *, PyObject *, PyObject *);
// Class Definition -----------------------------------------------
static PyType_Slot PySideSlotType_slots[] = {
@@ -94,20 +94,20 @@ static PyTypeObject *PySideSlotTypeF(void)
int slotTpInit(PyObject *self, PyObject *args, PyObject *kw)
{
- static PyObject *emptyTuple = 0;
- static const char *kwlist[] = {"name", "result", 0};
- char* argName = 0;
- PyObject* argResult = 0;
+ static PyObject *emptyTuple = nullptr;
+ static const char *kwlist[] = {"name", "result", nullptr};
+ char *argName = nullptr;
+ PyObject *argResult = nullptr;
if (emptyTuple == 0)
emptyTuple = PyTuple_New(0);
if (!PyArg_ParseTupleAndKeywords(emptyTuple, kw, "|sO:QtCore." SLOT_DEC_NAME,
- const_cast<char**>(kwlist), &argName, &argResult)) {
+ const_cast<char **>(kwlist), &argName, &argResult)) {
return 0;
}
- PySideSlot *data = reinterpret_cast<PySideSlot*>(self);
+ PySideSlot *data = reinterpret_cast<PySideSlot *>(self);
if (!data->slotData)
data->slotData = new SlotData;
for(Py_ssize_t i = 0, i_max = PyTuple_Size(args); i < i_max; i++) {
@@ -133,13 +133,13 @@ int slotTpInit(PyObject *self, PyObject *args, PyObject *kw)
PyObject *slotCall(PyObject *self, PyObject *args, PyObject * /* kw */)
{
- static PyObject* pySlotName = 0;
- PyObject* callback;
+ static PyObject *pySlotName = nullptr;
+ PyObject *callback;
callback = PyTuple_GetItem(args, 0);
Py_INCREF(callback);
if (PyFunction_Check(callback)) {
- PySideSlot *data = reinterpret_cast<PySideSlot*>(self);
+ PySideSlot *data = reinterpret_cast<PySideSlot *>(self);
if (!data->slotData)
data->slotData = new SlotData;
@@ -179,7 +179,7 @@ PyObject *slotCall(PyObject *self, PyObject *args, PyObject * /* kw */)
namespace PySide { namespace Slot {
-void init(PyObject* module)
+void init(PyObject *module)
{
if (PyType_Ready(PySideSlotTypeF()) < 0)
return;
diff --git a/sources/pyside2/libpyside/pysideweakref.cpp b/sources/pyside2/libpyside/pysideweakref.cpp
index 6b5073db8..2b27f9545 100644
--- a/sources/pyside2/libpyside/pysideweakref.cpp
+++ b/sources/pyside2/libpyside/pysideweakref.cpp
@@ -46,10 +46,10 @@ typedef struct {
PyObject_HEAD
/* Type-specific fields go here. */
PySideWeakRefFunction weakref_func;
- void* user_data;
+ void *user_data;
} PySideCallableObject;
-static PyObject* CallableObject_call(PyObject* callable_object, PyObject* args, PyObject* kw);
+static PyObject *CallableObject_call(PyObject *callable_object, PyObject *args, PyObject *kw);
static PyType_Slot PySideCallableObjectType_slots[] = {
{Py_tp_call, (void *)CallableObject_call},
@@ -57,7 +57,7 @@ static PyType_Slot PySideCallableObjectType_slots[] = {
{0, 0}
};
static PyType_Spec PySideCallableObjectType_spec = {
- const_cast<char*>("PySide.Callable"),
+ const_cast<char *>("PySide.Callable"),
sizeof(PySideCallableObject),
0,
Py_TPFLAGS_DEFAULT,
@@ -74,7 +74,7 @@ static PyTypeObject *PySideCallableObjectTypeF()
static PyObject *CallableObject_call(PyObject *callable_object, PyObject *args, PyObject * /* kw */)
{
- PySideCallableObject* obj = reinterpret_cast<PySideCallableObject *>(callable_object);
+ PySideCallableObject *obj = reinterpret_cast<PySideCallableObject *>(callable_object);
obj->weakref_func(obj->user_data);
Py_XDECREF(PyTuple_GET_ITEM(args, 0)); //kill weak ref object
@@ -83,7 +83,7 @@ static PyObject *CallableObject_call(PyObject *callable_object, PyObject *args,
namespace PySide { namespace WeakRef {
-PyObject* create(PyObject* obj, PySideWeakRefFunction func, void* userData)
+PyObject *create(PyObject *obj, PySideWeakRefFunction func, void *userData)
{
if (obj == Py_None)
return 0;
@@ -94,11 +94,11 @@ PyObject* create(PyObject* obj, PySideWeakRefFunction func, void* userData)
PyType_Ready(PySideCallableObjectTypeF());
}
- PySideCallableObject* callable = PyObject_New(PySideCallableObject, PySideCallableObjectTypeF());
+ PySideCallableObject *callable = PyObject_New(PySideCallableObject, PySideCallableObjectTypeF());
if (!callable || PyErr_Occurred())
return 0;
- PyObject* weak = PyWeakref_NewRef(obj, reinterpret_cast<PyObject *>(callable));
+ PyObject *weak = PyWeakref_NewRef(obj, reinterpret_cast<PyObject *>(callable));
if (!weak || PyErr_Occurred())
return 0;
diff --git a/sources/pyside2/libpyside/signalmanager.cpp b/sources/pyside2/libpyside/signalmanager.cpp
index 8925ffd35..0895cc682 100644
--- a/sources/pyside2/libpyside/signalmanager.cpp
+++ b/sources/pyside2/libpyside/signalmanager.cpp
@@ -82,26 +82,26 @@
namespace {
static PyObject *metaObjectAttr = 0;
- static int callMethod(QObject* object, int id, void** args);
- static PyObject* parseArguments(const QList< QByteArray >& paramTypes, void** args);
- static bool emitShortCircuitSignal(QObject* source, int signalIndex, PyObject* args);
+ static int callMethod(QObject *object, int id, void **args);
+ static PyObject *parseArguments(const QList< QByteArray >& paramTypes, void **args);
+ static bool emitShortCircuitSignal(QObject *source, int signalIndex, PyObject *args);
#ifdef IS_PY3K
- static void destroyMetaObject(PyObject* obj)
+ static void destroyMetaObject(PyObject *obj)
{
- void* ptr = PyCapsule_GetPointer(obj, 0);
- auto meta = reinterpret_cast<PySide::MetaObjectBuilder*>(ptr);
- SbkObject* wrapper = Shiboken::BindingManager::instance().retrieveWrapper(meta);
+ void *ptr = PyCapsule_GetPointer(obj, 0);
+ auto meta = reinterpret_cast<PySide::MetaObjectBuilder *>(ptr);
+ SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(meta);
if (wrapper)
Shiboken::BindingManager::instance().releaseWrapper(wrapper);
delete meta;
}
#else
- static void destroyMetaObject(void* obj)
+ static void destroyMetaObject(void *obj)
{
- auto meta = reinterpret_cast<PySide::MetaObjectBuilder*>(obj);
- SbkObject* wrapper = Shiboken::BindingManager::instance().retrieveWrapper(meta);
+ auto meta = reinterpret_cast<PySide::MetaObjectBuilder *>(obj);
+ SbkObject *wrapper = Shiboken::BindingManager::instance().retrieveWrapper(meta);
if (wrapper)
Shiboken::BindingManager::instance().releaseWrapper(wrapper);
delete meta;
@@ -118,7 +118,7 @@ PyObjectWrapper::PyObjectWrapper()
Py_XINCREF(m_me);
}
-PyObjectWrapper::PyObjectWrapper(PyObject* me)
+PyObjectWrapper::PyObjectWrapper(PyObject *me)
: m_me(me)
{
Py_XINCREF(m_me);
@@ -148,18 +148,18 @@ void PyObjectWrapper::reset(PyObject *o)
m_me = o;
}
-PyObjectWrapper& PyObjectWrapper::operator=(const PySide::PyObjectWrapper& other)
+PyObjectWrapper &PyObjectWrapper::operator=(const PySide::PyObjectWrapper &other)
{
reset(other.m_me);
return *this;
}
-PyObjectWrapper::operator PyObject*() const
+PyObjectWrapper::operator PyObject *() const
{
return m_me;
}
-QDataStream &operator<<(QDataStream& out, const PyObjectWrapper& myObj)
+QDataStream &operator<<(QDataStream &out, const PyObjectWrapper &myObj)
{
if (Py_IsInitialized() == 0) {
qWarning() << "Stream operator for PyObject called without python interpreter.";
@@ -173,9 +173,9 @@ QDataStream &operator<<(QDataStream& out, const PyObjectWrapper& myObj)
Shiboken::AutoDecRef pickleModule(PyImport_ImportModule("pickle"));
reduce_func = PyObject_GetAttrString(pickleModule, "dumps");
}
- Shiboken::AutoDecRef repr(PyObject_CallFunctionObjArgs(reduce_func, (PyObject*)myObj, NULL));
+ Shiboken::AutoDecRef repr(PyObject_CallFunctionObjArgs(reduce_func, (PyObject *)myObj, NULL));
if (repr.object()) {
- const char* buff = 0;
+ const char *buff = nullptr;
Py_ssize_t size = 0;
if (PyBytes_Check(repr.object())) {
buff = PyBytes_AS_STRING(repr.object());
@@ -190,7 +190,7 @@ QDataStream &operator<<(QDataStream& out, const PyObjectWrapper& myObj)
return out;
}
-QDataStream &operator>>(QDataStream& in, PyObjectWrapper& myObj)
+QDataStream &operator>>(QDataStream &in, PyObjectWrapper &myObj)
{
if (Py_IsInitialized() == 0) {
qWarning() << "Stream operator for PyObject called without python interpreter.";
@@ -225,7 +225,7 @@ struct SignalManager::SignalManagerPrivate
SignalManagerPrivate()
{
- m_globalReceivers = SharedMap( new QMap<QByteArray, GlobalReceiverV2*>() );
+ m_globalReceivers = SharedMap( new QMap<QByteArray, GlobalReceiverV2 *>() );
}
~SignalManagerPrivate()
@@ -246,17 +246,17 @@ static void clearSignalManager()
PySide::SignalManager::instance().clear();
}
-static void PyObject_PythonToCpp_PyObject_PTR(PyObject* pyIn, void* cppOut)
+static void PyObject_PythonToCpp_PyObject_PTR(PyObject *pyIn, void *cppOut)
{
- *((PyObject**)cppOut) = pyIn;
+ *reinterpret_cast<PyObject **>(cppOut) = pyIn;
}
-static PythonToCppFunc is_PyObject_PythonToCpp_PyObject_PTR_Convertible(PyObject* pyIn)
+static PythonToCppFunc is_PyObject_PythonToCpp_PyObject_PTR_Convertible(PyObject *pyIn)
{
return PyObject_PythonToCpp_PyObject_PTR;
}
-static PyObject* PyObject_PTR_CppToPython_PyObject(const void* cppIn)
+static PyObject *PyObject_PTR_CppToPython_PyObject(const void *cppIn)
{
- PyObject* pyOut = (PyObject*)cppIn;
+ auto pyOut = reinterpret_cast<PyObject *>(const_cast<void *>(cppIn));
if (pyOut)
Py_INCREF(pyOut);
return pyOut;
@@ -273,7 +273,7 @@ SignalManager::SignalManager() : m_d(new SignalManagerPrivate)
qRegisterMetaTypeStreamOperators<PyObjectWrapper>("PyObjectWrapper");
qRegisterMetaTypeStreamOperators<PyObjectWrapper>("PySide::PyObjectWrapper");
- SbkConverter* converter = Shiboken::Conversions::createConverter(&PyBaseObject_Type, 0);
+ SbkConverter *converter = Shiboken::Conversions::createConverter(&PyBaseObject_Type, nullptr);
Shiboken::Conversions::setCppPointerToPythonFunction(converter, PyObject_PTR_CppToPython_PyObject);
Shiboken::Conversions::setPythonToCppPointerFunctions(converter, PyObject_PythonToCpp_PyObject_PTR, is_PyObject_PythonToCpp_PyObject_PTR_Convertible);
Shiboken::Conversions::registerConverterName(converter, PYTHON_TYPE);
@@ -298,17 +298,17 @@ SignalManager::~SignalManager()
delete m_d;
}
-SignalManager& SignalManager::instance()
+SignalManager &SignalManager::instance()
{
static SignalManager me;
return me;
}
-QObject* SignalManager::globalReceiver(QObject *sender, PyObject *callback)
+QObject *SignalManager::globalReceiver(QObject *sender, PyObject *callback)
{
SharedMap globalReceivers = m_d->m_globalReceivers;
QByteArray hash = GlobalReceiverV2::hash(callback);
- GlobalReceiverV2* gr = 0;
+ GlobalReceiverV2 *gr = nullptr;
auto it = globalReceivers->find(hash);
if (it == globalReceivers->end()) {
gr = new GlobalReceiverV2(callback, globalReceivers);
@@ -323,7 +323,7 @@ QObject* SignalManager::globalReceiver(QObject *sender, PyObject *callback)
gr->incRef(sender);
}
- return reinterpret_cast<QObject*>(gr);
+ return reinterpret_cast<QObject *>(gr);
}
int SignalManager::countConnectionsWith(const QObject *object)
@@ -336,23 +336,23 @@ int SignalManager::countConnectionsWith(const QObject *object)
return count;
}
-void SignalManager::notifyGlobalReceiver(QObject* receiver)
+void SignalManager::notifyGlobalReceiver(QObject *receiver)
{
- reinterpret_cast<GlobalReceiverV2*>(receiver)->notify();
+ reinterpret_cast<GlobalReceiverV2 *>(receiver)->notify();
}
-void SignalManager::releaseGlobalReceiver(const QObject* source, QObject* receiver)
+void SignalManager::releaseGlobalReceiver(const QObject *source, QObject *receiver)
{
- GlobalReceiverV2* gr = reinterpret_cast<GlobalReceiverV2*>(receiver);
+ auto gr = reinterpret_cast<GlobalReceiverV2 *>(receiver);
gr->decRef(source);
}
-int SignalManager::globalReceiverSlotIndex(QObject* receiver, const char* signature) const
+int SignalManager::globalReceiverSlotIndex(QObject *receiver, const char *signature) const
{
- return reinterpret_cast<GlobalReceiverV2*>(receiver)->addSlot(signature);
+ return reinterpret_cast<GlobalReceiverV2 *>(receiver)->addSlot(signature);
}
-bool SignalManager::emitSignal(QObject* source, const char* signal, PyObject* args)
+bool SignalManager::emitSignal(QObject *source, const char *signal, PyObject *args)
{
if (!Signal::checkQtSignal(signal))
return false;
@@ -372,13 +372,13 @@ bool SignalManager::emitSignal(QObject* source, const char* signal, PyObject* ar
return false;
}
-int SignalManager::qt_metacall(QObject* object, QMetaObject::Call call, int id, void** args)
+int SignalManager::qt_metacall(QObject *object, QMetaObject::Call call, int id, void **args)
{
- const QMetaObject* metaObject = object->metaObject();
- PySideProperty* pp = 0;
- PyObject* pp_name = 0;
+ const QMetaObject *metaObject = object->metaObject();
+ PySideProperty *pp = nullptr;
+ PyObject *pp_name = nullptr;
QMetaProperty mp;
- PyObject* pySelf = 0;
+ PyObject *pySelf = nullptr;
int methodCount = metaObject->methodCount();
int propertyCount = metaObject->propertyCount();
@@ -389,7 +389,7 @@ int SignalManager::qt_metacall(QObject* object, QMetaObject::Call call, int id,
}
Shiboken::GilState gil;
- pySelf = (PyObject*)Shiboken::BindingManager::instance().retrieveWrapper(object);
+ pySelf = reinterpret_cast<PyObject *>(Shiboken::BindingManager::instance().retrieveWrapper(object));
Q_ASSERT(pySelf);
pp_name = Shiboken::String::fromCString(mp.name());
pp = Property::getObject(pySelf, pp_name);
@@ -504,22 +504,22 @@ int SignalManager::qt_metacall(QObject* object, QMetaObject::Call call, int id,
return id;
}
-int SignalManager::callPythonMetaMethod(const QMetaMethod& method, void** args, PyObject* pyMethod, bool isShortCuit)
+int SignalManager::callPythonMetaMethod(const QMetaMethod &method, void **args, PyObject *pyMethod, bool isShortCuit)
{
Q_ASSERT(pyMethod);
Shiboken::GilState gil;
- PyObject* pyArguments = 0;
+ PyObject *pyArguments = nullptr;
if (isShortCuit){
- pyArguments = reinterpret_cast<PyObject*>(args[1]);
+ pyArguments = reinterpret_cast<PyObject *>(args[1]);
} else {
pyArguments = parseArguments(method.parameterTypes(), args);
}
if (pyArguments) {
- Shiboken::Conversions::SpecificConverter* retConverter = NULL;
- const char* returnType = method.typeName();
+ Shiboken::Conversions::SpecificConverter *retConverter = nullptr;
+ const char *returnType = method.typeName();
if (returnType && std::strcmp("", returnType) && std::strcmp("void", returnType)) {
retConverter = new Shiboken::Conversions::SpecificConverter(returnType);
if (!retConverter || !*retConverter) {
@@ -543,13 +543,13 @@ int SignalManager::callPythonMetaMethod(const QMetaMethod& method, void** args,
return -1;
}
-bool SignalManager::registerMetaMethod(QObject* source, const char* signature, QMetaMethod::MethodType type)
+bool SignalManager::registerMetaMethod(QObject *source, const char *signature, QMetaMethod::MethodType type)
{
int ret = registerMetaMethodGetIndex(source, signature, type);
return (ret != -1);
}
-static MetaObjectBuilder *metaBuilderFromDict(PyObject* dict)
+static MetaObjectBuilder *metaBuilderFromDict(PyObject *dict)
{
if (!dict || !PyDict_Contains(dict, metaObjectAttr))
return nullptr;
@@ -562,33 +562,33 @@ static MetaObjectBuilder *metaBuilderFromDict(PyObject* dict)
#endif
}
-int SignalManager::registerMetaMethodGetIndex(QObject* source, const char* signature, QMetaMethod::MethodType type)
+int SignalManager::registerMetaMethodGetIndex(QObject *source, const char *signature, QMetaMethod::MethodType type)
{
if (!source) {
qWarning("SignalManager::registerMetaMethodGetIndex(\"%s\") called with source=nullptr.",
signature);
return -1;
}
- const QMetaObject* metaObject = source->metaObject();
+ const QMetaObject *metaObject = source->metaObject();
int methodIndex = metaObject->indexOfMethod(signature);
// Create the dynamic signal is needed
if (methodIndex == -1) {
- SbkObject* self = Shiboken::BindingManager::instance().retrieveWrapper(source);
+ SbkObject *self = Shiboken::BindingManager::instance().retrieveWrapper(source);
if (!Shiboken::Object::hasCppWrapper(self)) {
qWarning() << "Invalid Signal signature:" << signature;
return -1;
} else {
- PyObject *pySelf = reinterpret_cast<PyObject*>(self);
- PyObject* dict = self->ob_dict;
+ auto pySelf = reinterpret_cast<PyObject *>(self);
+ PyObject *dict = self->ob_dict;
MetaObjectBuilder *dmo = metaBuilderFromDict(dict);
// Create a instance meta object
if (!dmo) {
dmo = new MetaObjectBuilder(Py_TYPE(pySelf), metaObject);
#ifdef IS_PY3K
- PyObject* pyDmo = PyCapsule_New(dmo, 0, destroyMetaObject);
+ PyObject *pyDmo = PyCapsule_New(dmo, 0, destroyMetaObject);
#else
- PyObject* pyDmo = PyCObject_FromVoidPtr(dmo, destroyMetaObject);
+ PyObject *pyDmo = PyCObject_FromVoidPtr(dmo, destroyMetaObject);
#endif
PyObject_SetAttr(pySelf, metaObjectAttr, pyDmo);
@@ -604,12 +604,12 @@ int SignalManager::registerMetaMethodGetIndex(QObject* source, const char* signa
return methodIndex;
}
-const QMetaObject* SignalManager::retrieveMetaObject(PyObject *self)
+const QMetaObject *SignalManager::retrieveMetaObject(PyObject *self)
{
Shiboken::GilState gil;
Q_ASSERT(self);
- MetaObjectBuilder *builder = metaBuilderFromDict(reinterpret_cast<SbkObject*>(self)->ob_dict);
+ MetaObjectBuilder *builder = metaBuilderFromDict(reinterpret_cast<SbkObject *>(self)->ob_dict);
if (!builder)
builder = &(retrieveTypeUserData(self)->mo);
@@ -618,9 +618,9 @@ const QMetaObject* SignalManager::retrieveMetaObject(PyObject *self)
namespace {
-static int callMethod(QObject* object, int id, void** args)
+static int callMethod(QObject *object, int id, void **args)
{
- const QMetaObject* metaObject = object->metaObject();
+ const QMetaObject *metaObject = object->metaObject();
QMetaMethod method = metaObject->method(id);
if (method.methodType() == QMetaMethod::Signal) {
@@ -628,7 +628,7 @@ static int callMethod(QObject* object, int id, void** args)
QMetaObject::activate(object, id, args);
} else {
Shiboken::GilState gil;
- PyObject* self = (PyObject*)Shiboken::BindingManager::instance().retrieveWrapper(object);
+ auto self = reinterpret_cast<PyObject *>(Shiboken::BindingManager::instance().retrieveWrapper(object));
QByteArray methodName = method.methodSignature();
methodName.truncate(methodName.indexOf('('));
Shiboken::AutoDecRef pyMethod(PyObject_GetAttrString(self, methodName));
@@ -638,14 +638,14 @@ static int callMethod(QObject* object, int id, void** args)
}
-static PyObject* parseArguments(const QList<QByteArray>& paramTypes, void** args)
+static PyObject *parseArguments(const QList<QByteArray>& paramTypes, void **args)
{
int argsSize = paramTypes.count();
- PyObject* preparedArgs = PyTuple_New(argsSize);
+ PyObject *preparedArgs = PyTuple_New(argsSize);
for (int i = 0, max = argsSize; i < max; ++i) {
- void* data = args[i+1];
- const char* dataType = paramTypes[i].constData();
+ void *data = args[i+1];
+ const char *dataType = paramTypes[i].constData();
Shiboken::Conversions::SpecificConverter converter(dataType);
if (converter) {
PyTuple_SET_ITEM(preparedArgs, i, converter.toPython(data));
@@ -658,9 +658,9 @@ static PyObject* parseArguments(const QList<QByteArray>& paramTypes, void** args
return preparedArgs;
}
-static bool emitShortCircuitSignal(QObject* source, int signalIndex, PyObject* args)
+static bool emitShortCircuitSignal(QObject *source, int signalIndex, PyObject *args)
{
- void* signalArgs[2] = {0, args};
+ void *signalArgs[2] = {nullptr, args};
source->qt_metacall(QMetaObject::InvokeMetaMethod, signalIndex, signalArgs);
return true;
}
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;
}
diff --git a/sources/pyside2/plugins/customwidgets.cpp b/sources/pyside2/plugins/customwidgets.cpp
index 58d2a518c..e78dde206 100644
--- a/sources/pyside2/plugins/customwidgets.cpp
+++ b/sources/pyside2/plugins/customwidgets.cpp
@@ -43,21 +43,20 @@
struct PyCustomWidgetPrivate
{
- PyObject* pyObject;
+ PyObject *pyObject;
bool initialized;
};
struct PyCustomWidgetsPrivate
{
- QList<QDesignerCustomWidgetInterface*> widgets;
+ QList<QDesignerCustomWidgetInterface *> widgets;
~PyCustomWidgetsPrivate();
};
PyCustomWidgetsPrivate::~PyCustomWidgetsPrivate()
{
- foreach(QDesignerCustomWidgetInterface* iface, widgets)
- delete iface;
+ qDeleteAll(widgets);
widgets.clear();
}
@@ -71,12 +70,12 @@ PyCustomWidgets::~PyCustomWidgets()
delete m_data;
}
-void PyCustomWidgets::registerWidgetType(PyObject* widget)
+void PyCustomWidgets::registerWidgetType(PyObject *widget)
{
m_data->widgets.append(new PyCustomWidget(widget));
}
-QList<QDesignerCustomWidgetInterface*> PyCustomWidgets::customWidgets() const
+QList<QDesignerCustomWidgetInterface *> PyCustomWidgets::customWidgets() const
{
return m_data->widgets;
}
diff --git a/sources/pyside2/tests/pysidetest/hiddenobject.cpp b/sources/pyside2/tests/pysidetest/hiddenobject.cpp
index 24ef290ea..70692a8ec 100644
--- a/sources/pyside2/tests/pysidetest/hiddenobject.cpp
+++ b/sources/pyside2/tests/pysidetest/hiddenobject.cpp
@@ -38,7 +38,7 @@ bool HiddenObject::wasCalled()
return m_called;
}
-QObject* getHiddenObject()
+QObject *getHiddenObject()
{
return new HiddenObject();
}