summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2011-02-04 19:06:34 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:53:54 -0300
commit4ebad6745f9c85dd4f074fe328e0dd36ca8d6c18 (patch)
tree8c9f945ae8edc121d6f6192c17ffaae639fed63e
parent44998fd471927efb8c7a55e5bd7b81bad9f6e876 (diff)
Fixed problems to emit signals with objects types.
Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Lauro Moura <lauro.neto@openbossa.org>
-rw-r--r--libpyside/signalmanager.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/libpyside/signalmanager.cpp b/libpyside/signalmanager.cpp
index 7d5b5fc7..b41db1a3 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 {