aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Lima <hugo.lima@openbossa.org>2010-03-30 12:01:10 -0300
committerHugo Lima <hugo.lima@openbossa.org>2010-03-31 15:09:15 -0300
commit5bd8147956aa7b54af96ce4a0ec9f00afb8fcf88 (patch)
treeee8cd85236dd5b3fee52d8510c685a86288b9e18
parent718dd06ecd8443bc556f68bb17f7958e891ee48b (diff)
Adapt to changes in libshiboken
Reviewer: Anderson Lizardo <anderson.lizardo@openbossa.org> Reviewer: Bruno Araújo <bruno.araujo@openbossa.org>
-rw-r--r--PySide/QtCore/glue/qcoreapplication_init.cpp7
-rw-r--r--PySide/QtCore/qvariant_conversions.h2
-rw-r--r--PySide/QtCore/typesystem_core.xml2
-rw-r--r--PySide/QtGui/glue/qapplication_init.cpp7
-rw-r--r--libpyside/pysideconversions.h4
5 files changed, 14 insertions, 8 deletions
diff --git a/PySide/QtCore/glue/qcoreapplication_init.cpp b/PySide/QtCore/glue/qcoreapplication_init.cpp
index d290d6e7e..f53db030c 100644
--- a/PySide/QtCore/glue/qcoreapplication_init.cpp
+++ b/PySide/QtCore/glue/qcoreapplication_init.cpp
@@ -31,9 +31,12 @@ int SbkQCoreApplication_Init(PyObject* self, PyObject* args, PyObject*)
return -1;
}
- SbkBaseWrapper_setCptr(self, new QCoreApplication(QCoreApplicationArgCount, QCoreApplicationArgValues));
+ void* cptr = new QCoreApplication(QCoreApplicationArgCount, QCoreApplicationArgValues);
+ Shiboken::setCppPointer(reinterpret_cast<SbkBaseWrapper*>(self),
+ Shiboken::SbkType<QCoreApplication>(),
+ cptr);
SbkBaseWrapper_setValidCppObject(self, 1);
- Shiboken::BindingManager::instance().registerWrapper(reinterpret_cast<SbkBaseWrapper*>(self));
+ Shiboken::BindingManager::instance().registerWrapper(reinterpret_cast<SbkBaseWrapper*>(self), cptr);
Py_INCREF(self);
Py_AtExit(DeleteQCoreApplicationAtExit);
diff --git a/PySide/QtCore/qvariant_conversions.h b/PySide/QtCore/qvariant_conversions.h
index fc3f96f5c..d6c23efd4 100644
--- a/PySide/QtCore/qvariant_conversions.h
+++ b/PySide/QtCore/qvariant_conversions.h
@@ -82,7 +82,7 @@ inline QVariant Converter<QVariant>::toCpp(PyObject* pyobj)
}
} else {
// Is a known Qt type
- return QVariant(typeCode, reinterpret_cast<SbkBaseWrapper*>(pyobj)->cptr);
+ return QVariant(typeCode, reinterpret_cast<SbkBaseWrapper*>(pyobj)->cptr[0]);
}
}
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml
index 2a91dcbf4..67d48f79f 100644
--- a/PySide/QtCore/typesystem_core.xml
+++ b/PySide/QtCore/typesystem_core.xml
@@ -2786,7 +2786,7 @@
// The normal here would be to use the 'reference-count' tag but this
// method is strongly tied to 'setTargetState' since both affect the same
// internal value in QAbstractTransition.
- Shiboken::SbkBaseWrapper_keepReference(reinterpret_cast&lt;SbkBaseWrapper*&gt;(%PYSELF), "setTargetState(QAbstractState*)1", %PYARG_1);
+ Shiboken::keepReference(reinterpret_cast&lt;SbkBaseWrapper*&gt;(%PYSELF), "setTargetState(QAbstractState*)1", %PYARG_1);
</inject-code>
</modify-function>
diff --git a/PySide/QtGui/glue/qapplication_init.cpp b/PySide/QtGui/glue/qapplication_init.cpp
index 554641d46..20e487b70 100644
--- a/PySide/QtGui/glue/qapplication_init.cpp
+++ b/PySide/QtGui/glue/qapplication_init.cpp
@@ -30,9 +30,12 @@ int SbkQApplication_Init(PyObject* self, PyObject* args, PyObject*)
return -1;
}
- SbkBaseWrapper_setCptr(self, new QApplication(QApplicationArgCount, QApplicationArgValues));
+ void* cptr = new QApplication(QApplicationArgCount, QApplicationArgValues);
+ Shiboken::setCppPointer(reinterpret_cast<SbkBaseWrapper*>(self),
+ Shiboken::SbkType<QApplication>(),
+ cptr);
SbkBaseWrapper_setValidCppObject(self, 1);
- Shiboken::BindingManager::instance().registerWrapper(reinterpret_cast<SbkBaseWrapper*>(self));
+ Shiboken::BindingManager::instance().registerWrapper(reinterpret_cast<SbkBaseWrapper*>(self), cptr);
// Verify if qApp is in main module
const char QAPP_MACRO[] = "qApp";
diff --git a/libpyside/pysideconversions.h b/libpyside/pysideconversions.h
index 3c8effe9e..0c13d053b 100644
--- a/libpyside/pysideconversions.h
+++ b/libpyside/pysideconversions.h
@@ -78,7 +78,7 @@ struct QtDictConverter
static inline QtDict toCpp(PyObject* pyobj)
{
if (PyObject_TypeCheck(pyobj, Shiboken::SbkType<QtDict>()))
- return *reinterpret_cast<QtDict*>(SbkBaseWrapper_cptr(pyobj));
+ return *reinterpret_cast<QtDict*>(Shiboken::getCppPointer(pyobj, Shiboken::SbkType<QtDict>()));
QtDict result;
@@ -121,7 +121,7 @@ struct QSequenceConverter
static T toCpp(PyObject* pyobj)
{
if (PyObject_TypeCheck(pyobj, Shiboken::SbkType<T>()))
- return *reinterpret_cast<T*>(SbkBaseWrapper_cptr(pyobj));
+ return *reinterpret_cast<T*>(Shiboken::getCppPointer(pyobj, Shiboken::SbkType<T>()));
T result;
for (int i = 0; i < PySequence_Size(pyobj); i++) {