aboutsummaryrefslogtreecommitdiffstats
path: root/PySide/QtCore
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2010-11-23 14:37:16 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2010-11-23 14:37:16 -0200
commita8ae0680f23ca5e702a662cf36a465b7a7b2788a (patch)
tree13257f86b17d96261cd8713463bf75c14d507cbf /PySide/QtCore
parent6cefd33cd08232b25a3b81d598b88ec47aa5aad2 (diff)
Adapt to API changes in libshiboken.
Diffstat (limited to 'PySide/QtCore')
-rw-r--r--PySide/QtCore/glue/qbytearray_bufferprotocol.cpp4
-rw-r--r--PySide/QtCore/glue/qcoreapplication_init.cpp10
-rw-r--r--PySide/QtCore/glue/qobject_connect.cpp6
-rw-r--r--PySide/QtCore/qvariant_conversions.h12
-rw-r--r--PySide/QtCore/qvariant_type_conversions.h4
-rw-r--r--PySide/QtCore/typesystem_core.xml14
6 files changed, 25 insertions, 25 deletions
diff --git a/PySide/QtCore/glue/qbytearray_bufferprotocol.cpp b/PySide/QtCore/glue/qbytearray_bufferprotocol.cpp
index 19ee4e7b6..03ffcb4af 100644
--- a/PySide/QtCore/glue/qbytearray_bufferprotocol.cpp
+++ b/PySide/QtCore/glue/qbytearray_bufferprotocol.cpp
@@ -15,10 +15,10 @@ static Py_ssize_t SbkQByteArray_segcountproc(PyObject* self, Py_ssize_t* lenp)
static Py_ssize_t SbkQByteArray_readbufferproc(PyObject* self, Py_ssize_t segment, void** ptrptr)
{
- if (segment || !Shiboken::Wrapper::isValid(self))
+ if (segment || !Shiboken::Object::isValid(self))
return -1;
- QByteArray* cppSelf = Converter<QByteArray*>::toCpp(self);
+ QByteArray* cppSelf = Shiboken::Converter<QByteArray*>::toCpp(self);
*ptrptr = reinterpret_cast<void*>(cppSelf->data());
return cppSelf->size();
}
diff --git a/PySide/QtCore/glue/qcoreapplication_init.cpp b/PySide/QtCore/glue/qcoreapplication_init.cpp
index 446074c67..0c0e1f8fe 100644
--- a/PySide/QtCore/glue/qcoreapplication_init.cpp
+++ b/PySide/QtCore/glue/qcoreapplication_init.cpp
@@ -4,7 +4,7 @@ static char** QCoreApplicationArgValues;
int Sbk_QCoreApplication_Init(PyObject* self, PyObject* args, PyObject*)
{
- if (Shiboken::Wrapper::isUserType(self) && !Shiboken::BaseType::canCallConstructor(self->ob_type, Shiboken::SbkType<QApplication >()))
+ if (Shiboken::Object::isUserType(self) && !Shiboken::ObjectType::canCallConstructor(self->ob_type, Shiboken::SbkType<QApplication >()))
return -1;
@@ -26,13 +26,13 @@ int Sbk_QCoreApplication_Init(PyObject* self, PyObject* args, PyObject*)
SbkObject* sbkSelf = reinterpret_cast<SbkObject*>(self);
QCoreApplicationWrapper* cptr = new QCoreApplicationWrapper(QCoreApplicationArgCount, QCoreApplicationArgValues);
- Shiboken::Wrapper::setCppPointer(sbkSelf,
+ Shiboken::Object::setCppPointer(sbkSelf,
Shiboken::SbkType<QCoreApplication>(),
cptr);
- Shiboken::Wrapper::setValidCpp(sbkSelf, true);
- Shiboken::Wrapper::setHasCppWrapper(sbkSelf, true);
- Shiboken::Wrapper::releaseOwnership(sbkSelf);
+ Shiboken::Object::setValidCpp(sbkSelf, true);
+ Shiboken::Object::setHasCppWrapper(sbkSelf, true);
+ Shiboken::Object::releaseOwnership(sbkSelf);
Shiboken::BindingManager::instance().registerWrapper(sbkSelf, cptr);
PySide::Signal::updateSourceObject(self);
diff --git a/PySide/QtCore/glue/qobject_connect.cpp b/PySide/QtCore/glue/qobject_connect.cpp
index dea4440a5..91c830abd 100644
--- a/PySide/QtCore/glue/qobject_connect.cpp
+++ b/PySide/QtCore/glue/qobject_connect.cpp
@@ -3,11 +3,11 @@ static bool getReceiver(PyObject* callback, QObject** receiver, PyObject** self)
if (PyMethod_Check(callback)) {
*self = PyMethod_GET_SELF(callback);
if (Shiboken::Converter<QObject*>::checkType(*self))
- *receiver = Converter<QObject*>::toCpp(*self);
+ *receiver = Shiboken::Converter<QObject*>::toCpp(*self);
} else if (PyCFunction_Check(callback)) {
*self = PyCFunction_GET_SELF(callback);
if (*self && Shiboken::Converter<QObject*>::checkType(*self))
- *receiver = Converter<QObject*>::toCpp(*self);
+ *receiver = Shiboken::Converter<QObject*>::toCpp(*self);
} else if (PyCallable_Check(callback)) {
// Ok, just a callable object
*receiver = 0;
@@ -66,7 +66,7 @@ static bool qobjectConnectCallback(QObject* source, const char* signal, PyObject
const char* slot = callbackSig.constData();
int slotIndex = metaObject->indexOfSlot(slot);
if (slotIndex == -1) {
- if (!usingGlobalReceiver && self && !Shiboken::Wrapper::hasCppWrapper((SbkObject*)self)) {
+ if (!usingGlobalReceiver && self && !Shiboken::Object::hasCppWrapper((SbkObject*)self)) {
qWarning() << "You can't add dynamic slots on an object originated from C++.";
return false;
}
diff --git a/PySide/QtCore/qvariant_conversions.h b/PySide/QtCore/qvariant_conversions.h
index bfff5651f..68b6e8f5a 100644
--- a/PySide/QtCore/qvariant_conversions.h
+++ b/PySide/QtCore/qvariant_conversions.h
@@ -16,13 +16,13 @@ struct Converter<QVariant>
static QByteArray resolveMetaType(PyTypeObject* type, int &typeId)
{
- if (PyObject_TypeCheck(type, &SbkBaseType_Type)) {
- SbkBaseType* sbkType = reinterpret_cast<SbkBaseType*>(type);
- QByteArray typeName(Shiboken::BaseType::getOriginalName(sbkType));
+ if (PyObject_TypeCheck(type, &SbkObjectType_Type)) {
+ SbkObjectType* sbkType = reinterpret_cast<SbkObjectType*>(type);
+ QByteArray typeName(Shiboken::ObjectType::getOriginalName(sbkType));
bool valueType = !typeName.endsWith("*");
// Do not convert user type of value
- if (valueType && Shiboken::BaseType::isUserType(type))
+ if (valueType && Shiboken::ObjectType::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::Wrapper::checkType(pyObj)) {
- SbkBaseType* objType = reinterpret_cast<SbkBaseType*>(pyObj->ob_type);
+ if (Shiboken::Object::checkType(pyObj)) {
+ SbkObjectType* objType = reinterpret_cast<SbkObjectType*>(pyObj->ob_type);
int typeCode = 0;
QByteArray typeName = resolveMetaType(reinterpret_cast<PyTypeObject*>(objType), typeCode);
if (typeCode) {
diff --git a/PySide/QtCore/qvariant_type_conversions.h b/PySide/QtCore/qvariant_type_conversions.h
index 74b3289d1..bacf6c070 100644
--- a/PySide/QtCore/qvariant_type_conversions.h
+++ b/PySide/QtCore/qvariant_type_conversions.h
@@ -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 == &SbkBaseType_Type)
- typeName = Shiboken::BaseType::getOriginalName(reinterpret_cast<SbkBaseType*>(pyObj));
+ if (pyObj->ob_type == &SbkObjectType_Type)
+ typeName = Shiboken::ObjectType::getOriginalName(reinterpret_cast<SbkObjectType*>(pyObj));
else
typeName = reinterpret_cast<PyTypeObject*>(pyObj)->tp_name;
}
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 83fd2ed81..22c6be317 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -1931,7 +1931,7 @@
PyObject* pyTimer = Shiboken::SbkType&lt;QTimer>()->tp_new(Shiboken::SbkType&lt;QTimer>(), emptyTuple, 0);
Shiboken::SbkType&lt;QTimer>()->tp_init(pyTimer, emptyTuple, 0);
- QTimer* timer = Converter&lt;QTimer*>::toCpp(pyTimer);
+ QTimer* timer = %CONVERTTOCPP[QTimer*](pyTimer);
Shiboken::AutoDecRef result(
PyObject_CallMethod(pyTimer,
const_cast&lt;char*>("connect"),
@@ -1941,7 +1941,7 @@
%PYARG_2,
%3)
);
- Shiboken::Wrapper::invalidate((SbkObject*)pyTimer);
+ Shiboken::Object::invalidate((SbkObject*)pyTimer);
timer->setSingleShot(true);
timer->connect(timer, SIGNAL(timeout()), timer, SLOT(deleteLater()));
timer->start(%1);
@@ -1953,7 +1953,7 @@
Shiboken::AutoDecRef emptyTuple(PyTuple_New(0));
PyObject *pyTimer = Shiboken::SbkType&lt;QTimer>()->tp_new(Shiboken::SbkType&lt;QTimer>(), emptyTuple, 0);
Shiboken::SbkType&lt;QTimer>()->tp_init(pyTimer, emptyTuple, 0);
- QTimer* timer = Converter&lt;QTimer*>::toCpp(pyTimer);
+ QTimer* timer = %CONVERTTOCPP[QTimer*](pyTimer);
timer->setSingleShot(true);
timer->connect(timer, SIGNAL(timeout()), timer, SLOT(deleteLater()));
@@ -1979,7 +1979,7 @@
pyargs[1])
);
}
- Shiboken::Wrapper::invalidate((SbkObject*)pyTimer);
+ Shiboken::Object::invalidate((SbkObject*)pyTimer);
timer->start(%1);
</inject-code>
</add-function>
@@ -2567,7 +2567,7 @@
<inject-code class="target" position="beginning">
for(int counter = 0; counter &lt; %CPPSELF.animationCount(); ++counter ) {
PyObject* obj = %CONVERTTOPYTHON[QAbstractAnimation*](%CPPSELF.animationAt(counter));
- Shiboken::Wrapper::setParent(NULL, obj);
+ Shiboken::Object::setParent(NULL, obj);
Py_DECREF(obj);
}
%CPPSELF.clear();
@@ -2721,7 +2721,7 @@
%PYARG_0 = PySet_New(0);
foreach(QAbstractState* abs_state, %CPPSELF.configuration()) {
Shiboken::AutoDecRef obj(%CONVERTTOPYTHON[QAbstractState*](abs_state));
- Shiboken::Wrapper::setParent(self, obj);
+ Shiboken::Object::setParent(self, obj);
PySet_Add(%PYARG_0, obj);
}
</inject-code>
@@ -2732,7 +2732,7 @@
%PYARG_0 = PyList_New(0);
foreach(QAbstractAnimation* abs_anim, %CPPSELF.defaultAnimations()) {
Shiboken::AutoDecRef obj(%CONVERTTOPYTHON[QAbstractAnimation*](abs_anim));
- Shiboken::Wrapper::setParent(self, obj);
+ Shiboken::Object::setParent(self, obj);
PyList_Append(%PYARG_0, obj);
}
</inject-code>