summaryrefslogtreecommitdiffstats
path: root/src/corelib/statemachine/qstatemachine.cpp
diff options
context:
space:
mode:
authorDavid Boddie <dboddie@trolltech.com>2009-08-28 13:01:55 (GMT)
committerDavid Boddie <dboddie@trolltech.com>2009-08-28 13:01:55 (GMT)
commit7a69207653d97037d76b3dedfa3fa67033962eb3 (patch)
tree0be4650fc332d9c5197dac3877567cb23504db77 /src/corelib/statemachine/qstatemachine.cpp
parent9725ab222ffceb34b93af01631b273404ab784a9 (diff)
parent406f13e53ad78ba65b15ee7f06787e1d8a5d3fdd (diff)
downloadQt-7a69207653d97037d76b3dedfa3fa67033962eb3.zip
Qt-7a69207653d97037d76b3dedfa3fa67033962eb3.tar.gz
Qt-7a69207653d97037d76b3dedfa3fa67033962eb3.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src/corelib/statemachine/qstatemachine.cpp')
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index d6946de..e5bca2c 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -1408,6 +1408,7 @@ void QStateMachinePrivate::registerSignalTransition(QSignalTransition *transitio
signal.remove(0, 1);
const QMetaObject *meta = sender->metaObject();
int signalIndex = meta->indexOfSignal(signal);
+ int originalSignalIndex = signalIndex;
if (signalIndex == -1) {
signalIndex = meta->indexOfSignal(QMetaObject::normalizedSignature(signal));
if (signalIndex == -1) {
@@ -1416,6 +1417,11 @@ void QStateMachinePrivate::registerSignalTransition(QSignalTransition *transitio
return;
}
}
+ // The signal index we actually want to connect to is the one
+ // that is going to be sent, i.e. the non-cloned original index.
+ while (meta->method(signalIndex).attributes() & QMetaMethod::Cloned)
+ --signalIndex;
+
QVector<int> &connectedSignalIndexes = connections[sender];
if (connectedSignalIndexes.size() <= signalIndex)
connectedSignalIndexes.resize(signalIndex+1);
@@ -1435,6 +1441,7 @@ void QStateMachinePrivate::registerSignalTransition(QSignalTransition *transitio
}
++connectedSignalIndexes[signalIndex];
QSignalTransitionPrivate::get(transition)->signalIndex = signalIndex;
+ QSignalTransitionPrivate::get(transition)->originalSignalIndex = originalSignalIndex;
#ifdef QSTATEMACHINE_DEBUG
qDebug() << q << ": added signal transition from" << transition->sourceState()
<< ": ( sender =" << sender << ", signal =" << signal