diff options
author | renatofilho <renato.filho@openbossa.org> | 2010-10-19 15:21:23 -0300 |
---|---|---|
committer | renatofilho <renato.filho@openbossa.org> | 2010-10-19 17:07:37 -0300 |
commit | ae942fd5dae9e59cae78a32ed598001bf70e523e (patch) | |
tree | 0da428c3cdee66337ad15164b1accf9392ffd347 /PySide | |
parent | bea4934c04fe49eedff218e9905926ec3477e0b1 (diff) | |
download | pyside-ae942fd5dae9e59cae78a32ed598001bf70e523e.tar.gz pyside-ae942fd5dae9e59cae78a32ed598001bf70e523e.tar.xz pyside-ae942fd5dae9e59cae78a32ed598001bf70e523e.zip |
Included QSignalTransition constructor to support Signal objects.
Created unit test.
Fixes bug #416
Reviewer: Hugo Parente Lima <hugo.pl@gmail.com>
Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'PySide')
-rw-r--r-- | PySide/QtCore/typesystem_core.xml | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/PySide/QtCore/typesystem_core.xml b/PySide/QtCore/typesystem_core.xml index e9f5f31..6f9524b 100644 --- a/PySide/QtCore/typesystem_core.xml +++ b/PySide/QtCore/typesystem_core.xml @@ -2640,7 +2640,24 @@ <object-type name="QSequentialAnimationGroup"/> - <object-type name="QSignalTransition"/> + <object-type name="QSignalTransition"> + <add-function signature="QSignalTransition(PyObject*, QState*)" return-type="QSignalTransition*"> + <modify-argument index="2"> + <replace-default-expression with="0" /> + </modify-argument> + <inject-code> + if (PyObject_TypeCheck(%1, &PySide::SignalInstance_Type)) { + PySide::SignalInstanceData* data = (PySide::SignalInstanceData*) %PYARG_1; + Shiboken::AutoDecRef obType(PyObject_Type(data->source)); + QObject* sender = %CONVERTTOCPP[QObject*](data->source); + if (sender) { + QByteArray signature(data->signature); // Append SIGNAL flag (2) + %0 = new QSignalTransitionWrapper(sender, "2" + signature, %2); + } + } + </inject-code> + </add-function> + </object-type> <object-type name="QState"> <enum-type name="ChildMode"/> @@ -2663,7 +2680,6 @@ } </inject-code> </modify-function> - <modify-function signature="addTransition(QAbstractState*)"> <modify-argument index="1"> <parent index="this" action="add"/> |