summaryrefslogtreecommitdiffstats
path: root/PySide/QtDeclarative/pysideqmlregistertype.cpp
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-12-11 23:13:12 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2011-12-12 19:17:41 -0300
commit85cf74816ca6a6ff01c9358ed5a586fc36522af1 (patch)
treee41f0154d402ae47ca1fc46227390c70c6698046 /PySide/QtDeclarative/pysideqmlregistertype.cpp
parentc535327e6444d9fca88f3ab3c787fea60c52bccc (diff)
downloadpyside-85cf74816ca6a6ff01c9358ed5a586fc36522af1.tar.gz
pyside-85cf74816ca6a6ff01c9358ed5a586fc36522af1.tar.xz
pyside-85cf74816ca6a6ff01c9358ed5a586fc36522af1.zip
No more training wheels. The last occurrences of the old template Converter where removed.
Also related fixes here and there.
Diffstat (limited to 'PySide/QtDeclarative/pysideqmlregistertype.cpp')
-rw-r--r--PySide/QtDeclarative/pysideqmlregistertype.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/PySide/QtDeclarative/pysideqmlregistertype.cpp b/PySide/QtDeclarative/pysideqmlregistertype.cpp
index 30844c6..4efc4bf 100644
--- a/PySide/QtDeclarative/pysideqmlregistertype.cpp
+++ b/PySide/QtDeclarative/pysideqmlregistertype.cpp
@@ -282,12 +282,13 @@ int propListCount(QDeclarativeListProperty<QDeclarativeItem>* propList)
Shiboken::AutoDecRef retVal(PyObject_CallObject(data->count, args));
// Check return type
+ int cppResult = 0;
+ PythonToCppFunc pythonToCpp;
if (PyErr_Occurred())
PyErr_Print();
- else if (Shiboken::Converter<int>::isConvertible(retVal))
- return Shiboken::Converter<int>::toCpp(retVal);
-
- return 0;
+ else if ((pythonToCpp = Shiboken::Conversions::isPythonToCppConvertible(Shiboken::Conversions::PrimitiveTypeConverter<int>(), retVal)))
+ pythonToCpp(retVal, &cppResult);
+ return cppResult;
}
// Implementation of QDeclarativeListProperty<T>::AtFunction callback
@@ -302,12 +303,12 @@ QDeclarativeItem* propListAt(QDeclarativeListProperty<QDeclarativeItem>* propLis
DeclarativeListProperty* data = reinterpret_cast<DeclarativeListProperty*>(propList->data);
Shiboken::AutoDecRef retVal(PyObject_CallObject(data->at, args));
+ QDeclarativeItem* result = 0;
if (PyErr_Occurred())
PyErr_Print();
else if (PyType_IsSubtype(Py_TYPE(retVal), data->type))
- return Shiboken::Converter<QDeclarativeItem*>::toCpp(retVal);
-
- return 0;
+ Shiboken::Conversions::pythonToCppPointer((SbkObjectType*)SbkPySide_QtCoreTypes[SBK_QDECLARATIVEITEM_IDX], retVal, &result);
+ return result;
}
// Implementation of QDeclarativeListProperty<T>::ClearFunction callback
@@ -332,7 +333,9 @@ static void propListMetaCall(PySideProperty* pp, PyObject* self, QMetaObject::Ca
return;
DeclarativeListProperty* data = reinterpret_cast<DeclarativeListProperty*>(PySide::Property::userData(pp));
- QDeclarativeListProperty<QDeclarativeItem> declProp(Shiboken::Converter<QObject*>::toCpp(self), data, &propListAppender);
+ QObject* qobj;
+ Shiboken::Conversions::pythonToCppPointer((SbkObjectType*)SbkPySide_QtCoreTypes[SBK_QOBJECT_IDX], self, &qobj);
+ QDeclarativeListProperty<QDeclarativeItem> declProp(qobj, data, &propListAppender);
if (data->count)
declProp.count = &propListCount;