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.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/corelib/statemachine/qstate.cpp b/src/corelib/statemachine/qstate.cpp
index 5463059..5dd56c0 100644
--- a/src/corelib/statemachine/qstate.cpp
+++ b/src/corelib/statemachine/qstate.cpp
@@ -40,6 +40,9 @@
****************************************************************************/
#include "qstate.h"
+
+#ifndef QT_NO_STATEMACHINE
+
#include "qstate_p.h"
#include "qhistorystate.h"
#include "qhistorystate_p.h"
@@ -329,9 +332,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);
@@ -481,3 +485,5 @@ bool QState::event(QEvent *e)
*/
QT_END_NAMESPACE
+
+#endif //QT_NO_STATEMACHINE