summaryrefslogtreecommitdiffstats
path: root/src/corelib/statemachine/qstatemachine.cpp
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-06-22 12:44:55 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-06-22 12:50:11 (GMT)
commitdb92a780ceb130b6fa91ad866e521237c4b255b8 (patch)
tree01d7e77c82f652799cdfac86aadc6d8cf3e317b4 /src/corelib/statemachine/qstatemachine.cpp
parent24146ce4ad076fb6337b591d24e5a8c6a290fe41 (diff)
downloadQt-db92a780ceb130b6fa91ad866e521237c4b255b8.zip
Qt-db92a780ceb130b6fa91ad866e521237c4b255b8.tar.gz
Qt-db92a780ceb130b6fa91ad866e521237c4b255b8.tar.bz2
perform normalization of signatures for signal transitions
Make state->addTransition(foo, SIGNAL( bar( ) ), ...) work.
Diffstat (limited to 'src/corelib/statemachine/qstatemachine.cpp')
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index 758bdbe..682dd97 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -1316,11 +1316,15 @@ void QStateMachinePrivate::registerSignalTransition(QSignalTransition *transitio
QByteArray signal = QSignalTransitionPrivate::get(transition)->signal;
if (signal.startsWith('0'+QSIGNAL_CODE))
signal.remove(0, 1);
- int signalIndex = sender->metaObject()->indexOfSignal(signal);
+ const QMetaObject *meta = sender->metaObject();
+ int signalIndex = meta->indexOfSignal(signal);
if (signalIndex == -1) {
- qWarning("QSignalTransition: no such signal: %s::%s",
- sender->metaObject()->className(), signal.constData());
- return;
+ signalIndex = meta->indexOfSignal(QMetaObject::normalizedSignature(signal));
+ if (signalIndex == -1) {
+ qWarning("QSignalTransition: no such signal: %s::%s",
+ meta->className(), signal.constData());
+ return;
+ }
}
QVector<int> &connectedSignalIndexes = connections[sender];
if (connectedSignalIndexes.size() <= signalIndex)