diff options
Diffstat (limited to 'PySide/QtDeclarative')
-rw-r--r-- | PySide/QtDeclarative/pysideqmlregistertype.cpp | 18 | ||||
-rw-r--r-- | PySide/QtDeclarative/typesystem_declarative.xml | 4 |
2 files changed, 17 insertions, 5 deletions
diff --git a/PySide/QtDeclarative/pysideqmlregistertype.cpp b/PySide/QtDeclarative/pysideqmlregistertype.cpp index 7dfd7a622..6c595167b 100644 --- a/PySide/QtDeclarative/pysideqmlregistertype.cpp +++ b/PySide/QtDeclarative/pysideqmlregistertype.cpp @@ -258,7 +258,10 @@ PyTypeObject PropertyListType = { void propListAppender(QDeclarativeListProperty<QDeclarativeItem>* propList, QDeclarativeItem* item) { Shiboken::GilState state; - Shiboken::AutoDecRef args(Shiboken::makeTuple(propList->object, item)); + + Shiboken::AutoDecRef args(PyTuple_New(2)); + PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkPySide_QtCoreTypes[SBK_QOBJECT_IDX], propList->object)); + PyTuple_SET_ITEM(args, 1, Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkPySide_QtDeclarativeTypes[SBK_QDECLARATIVEITEM_IDX], item)); DeclarativeListProperty* data = reinterpret_cast<DeclarativeListProperty*>(propList->data); Shiboken::AutoDecRef retVal(PyObject_CallObject(data->append, args)); @@ -271,7 +274,9 @@ void propListAppender(QDeclarativeListProperty<QDeclarativeItem>* propList, QDec int propListCount(QDeclarativeListProperty<QDeclarativeItem>* propList) { Shiboken::GilState state; - Shiboken::AutoDecRef args(Shiboken::makeTuple(propList->object)); + + Shiboken::AutoDecRef args(PyTuple_New(1)); + PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkPySide_QtCoreTypes[SBK_QOBJECT_IDX], propList->object)); DeclarativeListProperty* data = reinterpret_cast<DeclarativeListProperty*>(propList->data); Shiboken::AutoDecRef retVal(PyObject_CallObject(data->count, args)); @@ -289,7 +294,10 @@ int propListCount(QDeclarativeListProperty<QDeclarativeItem>* propList) QDeclarativeItem* propListAt(QDeclarativeListProperty<QDeclarativeItem>* propList, int index) { Shiboken::GilState state; - Shiboken::AutoDecRef args(Shiboken::makeTuple(propList->object, index)); + + Shiboken::AutoDecRef args(PyTuple_New(2)); + PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkPySide_QtCoreTypes[SBK_QOBJECT_IDX], propList->object)); + PyTuple_SET_ITEM(args, 1, Shiboken::Conversions::copyToPython(Shiboken::Conversions::PrimitiveTypeConverter<int>(), &index)); DeclarativeListProperty* data = reinterpret_cast<DeclarativeListProperty*>(propList->data); Shiboken::AutoDecRef retVal(PyObject_CallObject(data->at, args)); @@ -306,7 +314,9 @@ QDeclarativeItem* propListAt(QDeclarativeListProperty<QDeclarativeItem>* propLis void propListClear(QDeclarativeListProperty<QDeclarativeItem>* propList) { Shiboken::GilState state; - Shiboken::AutoDecRef args(Shiboken::makeTuple(propList->object)); + + Shiboken::AutoDecRef args(PyTuple_New(1)); + PyTuple_SET_ITEM(args, 0, Shiboken::Conversions::pointerToPython((SbkObjectType*)SbkPySide_QtCoreTypes[SBK_QOBJECT_IDX], propList->object)); DeclarativeListProperty* data = reinterpret_cast<DeclarativeListProperty*>(propList->data); Shiboken::AutoDecRef retVal(PyObject_CallObject(data->clear, args)); diff --git a/PySide/QtDeclarative/typesystem_declarative.xml b/PySide/QtDeclarative/typesystem_declarative.xml index 58bce2ac0..91c2e487b 100644 --- a/PySide/QtDeclarative/typesystem_declarative.xml +++ b/PySide/QtDeclarative/typesystem_declarative.xml @@ -104,7 +104,9 @@ %BEGIN_ALLOW_THREADS %RETURN_TYPE ok_ = %CPPSELF.%FUNCTION_NAME(%1, %2, &errorString); %END_ALLOW_THREADS - %PYARG_0 = Shiboken::makeTuple(ok_, errorString); + %PYARG_0 = PyTuple_New(2); + PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](ok_)); + PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QString](errorString)); </inject-code> </modify-function> </object-type> |