Update to new Shiboken API (Renamed SbkObjectType)
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org>
Hugo Parente Lima <hugo.pl@gmail.com>
This commit is contained in:
parent
5e0550446c
commit
c9aef92cab
11 changed files with 30 additions and 32 deletions
|
|
@ -4,7 +4,7 @@ static char** QCoreApplicationArgValues;
|
|||
|
||||
int Sbk_QCoreApplication_Init(PyObject* self, PyObject* args, PyObject*)
|
||||
{
|
||||
if (Shiboken::isUserType(self) && !Shiboken::canCallConstructor(self->ob_type, Shiboken::SbkType<QApplication >()))
|
||||
if (Shiboken::Wrapper::isUserType(self) && !Shiboken::BaseType::canCallConstructor(self->ob_type, Shiboken::SbkType<QApplication >()))
|
||||
return -1;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -16,13 +16,13 @@ struct Converter<QVariant>
|
|||
|
||||
static QByteArray resolveMetaType(PyTypeObject* type, int &typeId)
|
||||
{
|
||||
if (PyObject_TypeCheck(type, &SbkObjectType_Type)) {
|
||||
SbkObjectType* sbkType = reinterpret_cast<SbkObjectType*>(type);
|
||||
QByteArray typeName(sbkType->original_name);
|
||||
if (PyObject_TypeCheck(type, &SbkBaseType_Type)) {
|
||||
SbkBaseType* sbkType = reinterpret_cast<SbkBaseType*>(type);
|
||||
QByteArray typeName(Shiboken::BaseType::getOriginalName(sbkType));
|
||||
bool valueType = !typeName.endsWith("*");
|
||||
|
||||
// Do not convert user type of value
|
||||
if (valueType && sbkType->is_user_type)
|
||||
if (valueType && Shiboken::BaseType::isUserType(type))
|
||||
return QByteArray();
|
||||
|
||||
int obTypeId = QMetaType::type(typeName);
|
||||
|
|
@ -86,8 +86,8 @@ struct Converter<QVariant>
|
|||
return convertToVariantList(pyObj);
|
||||
} else {
|
||||
// a class supported by QVariant?
|
||||
if (Shiboken::isShibokenType(pyObj)) {
|
||||
SbkObjectType* objType = reinterpret_cast<SbkObjectType*>(pyObj->ob_type);
|
||||
if (Shiboken::Wrapper::checkType(pyObj)) {
|
||||
SbkBaseType* objType = reinterpret_cast<SbkBaseType*>(pyObj->ob_type);
|
||||
int typeCode = 0;
|
||||
QByteArray typeName = resolveMetaType(reinterpret_cast<PyTypeObject*>(objType), typeCode);
|
||||
if (typeCode) {
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ struct Converter<QVariant::Type>
|
|||
else if (pyObj == reinterpret_cast<PyObject*>(&PyLong_Type))
|
||||
typeName = "int"; // long is a UserType in QVariant.
|
||||
else if (PyType_Check(pyObj)) {
|
||||
if (pyObj->ob_type == &SbkObjectType_Type)
|
||||
typeName = reinterpret_cast<SbkObjectType*>(pyObj)->original_name;
|
||||
if (pyObj->ob_type == &SbkBaseType_Type)
|
||||
typeName = Shiboken::BaseType::getOriginalName(reinterpret_cast<SbkBaseType*>(pyObj));
|
||||
else
|
||||
typeName = reinterpret_cast<PyTypeObject*>(pyObj)->tp_name;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue