summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-06-03 11:17:37 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-06-03 11:17:37 (GMT)
commite72285b0108f7649366a106f1c16ea73611dbcd4 (patch)
treead1abc0554c9330737879805081589c0dec10559 /src/corelib
parentf9aa7cbaea69168a4e7b9411cfdceb9e27cf75a9 (diff)
downloadQt-e72285b0108f7649366a106f1c16ea73611dbcd4.zip
Qt-e72285b0108f7649366a106f1c16ea73611dbcd4.tar.gz
Qt-e72285b0108f7649366a106f1c16ea73611dbcd4.tar.bz2
don't require use of SIGNAL macro in calls to addTransition()
Just as with the QSignalTransition::signal property, this makes it possible to use the function from language bindings (e.g. QtScript).
Diffstat (limited to 'src/corelib')
-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);