diff options
author | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-10-13 15:46:07 -0300 |
---|---|---|
committer | Marcelo Lira <marcelo.lira@openbossa.org> | 2010-10-13 15:49:05 -0300 |
commit | 0568190e8b39e52660efed55004a5da2a2535944 (patch) | |
tree | d4afa44b6a25cbb88288f4eefff262c06fb5373b /PySide/QtCore/typesystem_core.xml | |
parent | 7fab5c03a94a24f6496ad129485244f7d6f4f994 (diff) |
Adjusted QTimer.singleShot custom code since all Signals are callable now.
Reviewed by Luciano Wolf <luciano.wolf@openbossa.org>
Reviewed by Renato Araújo <renato.filho@openbossa.org>
Diffstat (limited to 'PySide/QtCore/typesystem_core.xml')
-rw-r--r-- | PySide/QtCore/typesystem_core.xml | 58 |
1 files changed, 22 insertions, 36 deletions
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml index d6fe524bb..9d36c3f8a 100644 --- a/PySide/QtCore/typesystem_core.xml +++ b/PySide/QtCore/typesystem_core.xml @@ -1778,42 +1778,28 @@ timer->setSingleShot(true); timer->connect(timer, SIGNAL(timeout()), timer, SLOT(deleteLater())); - Shiboken::AutoDecRef result( - PyObject_CallMethod(pyTimer, - const_cast<char*>("connect"), - const_cast<char*>("OsO"), - pyTimer, - SIGNAL(timeout()), - pyargs[1]) - ); - Shiboken::BindingManager::instance().destroyWrapper((Shiboken::SbkBaseWrapper *)pyTimer); - timer->start(%1); - </inject-code> - </add-function> - <!-- Second argument is a PySide.QtCore.Signal. See bug #362. --> - <add-function signature="singleShot(int, PyObject*)" static="yes"> - <inject-code class="target" position="beginning"> - if (!PyObject_TypeCheck(%2, &PySideSignalInstanceType)) - goto Sbk%TYPEFunc_%FUNCTION_NAME_TypeError; - - // %FUNCTION_NAME() - disable generation of c++ function call - Shiboken::AutoDecRef emptyTuple(PyTuple_New(0)); - PyObject* pyTimer = Shiboken::SbkType<QTimer>()->tp_new(Shiboken::SbkType<QTimer>(), emptyTuple, 0); - Shiboken::SbkType<QTimer>()->tp_init(pyTimer, emptyTuple, 0); - QTimer* timer = Converter<QTimer*>::toCpp(pyTimer); - timer->setSingleShot(true); - timer->connect(timer, SIGNAL(timeout()), timer, SLOT(deleteLater())); - PySideSignalInstanceData* signalInstance = reinterpret_cast<PySideSignalInstanceData*>(%2); - Shiboken::AutoDecRef signalSignature(PyString_FromFormat("2%s", signalInstance->signature)); - Shiboken::AutoDecRef result( - PyObject_CallMethod(pyTimer, - const_cast<char*>("connect"), - const_cast<char*>("OsOO"), - pyTimer, - SIGNAL(timeout()), - signalInstance->source, - signalSignature.object()) - ); + if (PyObject_TypeCheck(%2, &PySideSignalInstanceType)) { + PySideSignalInstanceData* signalInstance = reinterpret_cast<PySideSignalInstanceData*>(%2); + Shiboken::AutoDecRef signalSignature(PyString_FromFormat("2%s", signalInstance->signature)); + Shiboken::AutoDecRef result( + PyObject_CallMethod(pyTimer, + const_cast<char*>("connect"), + const_cast<char*>("OsOO"), + pyTimer, + SIGNAL(timeout()), + signalInstance->source, + signalSignature.object()) + ); + } else { + Shiboken::AutoDecRef result( + PyObject_CallMethod(pyTimer, + const_cast<char*>("connect"), + const_cast<char*>("OsO"), + pyTimer, + SIGNAL(timeout()), + pyargs[1]) + ); + } Shiboken::BindingManager::instance().destroyWrapper((Shiboken::SbkBaseWrapper *)pyTimer); timer->start(%1); </inject-code> |