summaryrefslogtreecommitdiffstats
path: root/libpyside
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2011-02-04 19:06:34 -0300
committerRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2011-02-07 17:32:47 -0300
commit6b1f0b8ca7493f261723a09adb7be046d78ee535 (patch)
tree6a95231b8d8c597c02c8c4d13533176bf4a161d7 /libpyside
parent4e79ce7b25070795174980c195268a8e5721746f (diff)
downloadpyside-6b1f0b8ca7493f261723a09adb7be046d78ee535.tar.gz
pyside-6b1f0b8ca7493f261723a09adb7be046d78ee535.tar.xz
pyside-6b1f0b8ca7493f261723a09adb7be046d78ee535.zip
Fixed problems to emit signals with objects types.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Lauro Moura <lauro.neto@openbossa.org>
Diffstat (limited to 'libpyside')
-rw-r--r--libpyside/signalmanager.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/libpyside/signalmanager.cpp b/libpyside/signalmanager.cpp
index 7d5b5fc..b41db1a 100644
--- a/libpyside/signalmanager.cpp
+++ b/libpyside/signalmanager.cpp
@@ -201,10 +201,15 @@ static bool emitNormalSignal(QObject* source, int signalIndex, const char* signa
for (i = 0; i < argsGiven; ++i) {
QByteArray typeName = argTypes[i].toAscii();
Shiboken::TypeResolver* typeResolver = Shiboken::TypeResolver::get(typeName);
- int typeId = QMetaType::type(typeName);
- if (typeResolver && typeId) {
- if (Shiboken::TypeResolver::getType(typeName) == Shiboken::TypeResolver::ValueType)
+ if (typeResolver) {
+ if (Shiboken::TypeResolver::getType(typeName) == Shiboken::TypeResolver::ValueType) {
+ int typeId = QMetaType::type(typeName);
+ if (!typeId) {
+ PyErr_Format(PyExc_TypeError, "Value type used on signal needs to be registered on meta type: %s", typeName.data());
+ break;
+ }
signalValues[i] = QVariant(typeId, (void*) 0);
+ }
signalArgs[i+1] = signalValues[i].data();
typeResolver->toCpp(PySequence_Fast_GET_ITEM(sequence.object(), i), &signalArgs[i+1]);
} else {