summaryrefslogtreecommitdiffstats
path: root/src/corelib/statemachine/qstate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/statemachine/qstate.cpp')
-rw-r--r--src/corelib/statemachine/qstate.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/corelib/statemachine/qstate.cpp b/src/corelib/statemachine/qstate.cpp
index 5463059..ebb0b47 100644
--- a/src/corelib/statemachine/qstate.cpp
+++ b/src/corelib/statemachine/qstate.cpp
@@ -329,9 +329,10 @@ QSignalTransition *QState::addTransition(QObject *sender, const char *signal,
qWarning("QState::addTransition: cannot add transition to null state");
return 0;
}
- if (*signal && sender->metaObject()->indexOfSignal(signal+1) == -1) {
+ int offset = (*signal == '0'+QSIGNAL_CODE) ? 1 : 0;
+ if (sender->metaObject()->indexOfSignal(signal+offset) == -1) {
qWarning("QState::addTransition: no such signal %s::%s",
- sender->metaObject()->className(), signal+1);
+ sender->metaObject()->className(), signal+offset);
return 0;
}
QSignalTransition *trans = new QSignalTransition(sender, signal, QList<QAbstractState*>() << target);