diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-11-12 11:33:37 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-11-12 10:41:57 +0000 |
commit | f9662f9b4008f683d02c829ea59676a2cf49b2fb (patch) | |
tree | 5c2a1d68d1f4d8c960d985e28a18ef785b2d6e6f /sources/pyside6 | |
parent | d2ed3e7813b7fb731e4f6bda9207dba099b48494 (diff) |
PySide6: Fix QML list registration code to compile
The list interface was ported to qsizetype.
Change-Id: I1d69e64e73021028db1db8f1cce75e6a757e608b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'sources/pyside6')
-rw-r--r-- | sources/pyside6/PySide6/QtQml/pysideqmlregistertype.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sources/pyside6/PySide6/QtQml/pysideqmlregistertype.cpp b/sources/pyside6/PySide6/QtQml/pysideqmlregistertype.cpp index cb9ed6309..32be83334 100644 --- a/sources/pyside6/PySide6/QtQml/pysideqmlregistertype.cpp +++ b/sources/pyside6/PySide6/QtQml/pysideqmlregistertype.cpp @@ -384,7 +384,7 @@ void propListAppender(QQmlListProperty<QObject> *propList, QObject *item) } // Implementation of QQmlListProperty<T>::CountFunction callback -int propListCount(QQmlListProperty<QObject> *propList) +qsizetype propListCount(QQmlListProperty<QObject> *propList) { Shiboken::GilState state; @@ -399,19 +399,19 @@ int propListCount(QQmlListProperty<QObject> *propList) PythonToCppFunc pythonToCpp = 0; if (PyErr_Occurred()) PyErr_Print(); - else if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter<int>(), retVal))) + else if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter<qsizetype>(), retVal))) pythonToCpp(retVal, &cppResult); return cppResult; } // Implementation of QQmlListProperty<T>::AtFunction callback -QObject *propListAt(QQmlListProperty<QObject> *propList, int index) +QObject *propListAt(QQmlListProperty<QObject> *propList, qsizetype index) { Shiboken::GilState state; Shiboken::AutoDecRef args(PyTuple_New(2)); PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType *)SbkPySide6_QtCoreTypes[SBK_QOBJECT_IDX], propList->object)); - PyTuple_SET_ITEM(args, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<int>(), &index)); + PyTuple_SET_ITEM(args, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<qsizetype>(), &index)); auto data = reinterpret_cast<QmlListProperty *>(propList->data); Shiboken::AutoDecRef retVal(PyObject_CallObject(data->at, args)); @@ -440,13 +440,13 @@ void propListClear(QQmlListProperty<QObject> * propList) } // Implementation of QQmlListProperty<T>::ReplaceFunction callback -void propListReplace(QQmlListProperty<QObject> *propList, int index, QObject *value) +void propListReplace(QQmlListProperty<QObject> *propList, qsizetype index, QObject *value) { Shiboken::GilState state; Shiboken::AutoDecRef args(PyTuple_New(3)); PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType *)SbkPySide6_QtCoreTypes[SBK_QOBJECT_IDX], propList->object)); - PyTuple_SET_ITEM(args, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<int>(), &index)); + PyTuple_SET_ITEM(args, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<qsizetype>(), &index)); PyTuple_SET_ITEM(args, 2, Shiboken::Conversions::pointerToPython((SbkObjectType *)SbkPySide6_QtCoreTypes[SBK_QOBJECT_IDX], value)); auto data = reinterpret_cast<QmlListProperty *>(propList->data); |