summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/scxml/qscxmlparser.cpp16
-rw-r--r--src/scxml/qscxmlstatemachine.cpp10
-rw-r--r--tools/qscxmlc/scxmlcppdumper.cpp31
3 files changed, 0 insertions, 57 deletions
diff --git a/src/scxml/qscxmlparser.cpp b/src/scxml/qscxmlparser.cpp
index eb7f016..2efd203 100644
--- a/src/scxml/qscxmlparser.cpp
+++ b/src/scxml/qscxmlparser.cpp
@@ -1219,26 +1219,12 @@ private:
m_eventSlots.unite(node->events.toSet());
}
-#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
auto newTransition = new QScxmlTransition(node->events);
if (QHistoryState *parent = qobject_cast<QHistoryState*>(m_parents.last())) {
parent->setDefaultTransition(newTransition);
} else {
currentParent()->addTransition(newTransition);
}
-#else // See QTBUG-46703, which explains why the following is a bad work-around.
- QState *parentState = Q_NULLPTR;
- if (QHistoryState *parent = qobject_cast<QHistoryState*>(m_parents.last())) {
- // QHistoryState cannot have an initial transition, only an initial state.
- // So, work around that by creating an initial state, and add the transition to that.
- parentState = new QScxmlState(parent->parentState());
- parent->setDefaultState(parentState);
- } else {
- parentState = currentParent();
- }
- auto newTransition = new QScxmlTransition(parentState, node->events);
- parentState->addTransition(newTransition);
-#endif
if (node->condition) {
auto cond = createEvaluatorBool(QStringLiteral("transition"), QStringLiteral("cond"), *node->condition.data());
@@ -2318,10 +2304,8 @@ void QScxmlParserPrivate::parse()
QStringRef type = attributes.value(QLatin1String("type"));
if (type.isEmpty() || type == QLatin1String("external")) {
transition->type = DocumentModel::Transition::External;
-#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
} else if (type == QLatin1String("internal")) {
transition->type = DocumentModel::Transition::Internal;
-#endif
} else {
addError(QStringLiteral("invalid transition type '%1', valid values are 'external' and 'internal'").arg(type.toString()));
break;
diff --git a/src/scxml/qscxmlstatemachine.cpp b/src/scxml/qscxmlstatemachine.cpp
index 3ef07ae..fae3fdc 100644
--- a/src/scxml/qscxmlstatemachine.cpp
+++ b/src/scxml/qscxmlstatemachine.cpp
@@ -93,13 +93,11 @@ public:
{ return QScxmlStateMachinePrivate::get(stateMachine()); }
protected: // overrides for QStateMachinePrivate:
-#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
void noMicrostep() Q_DECL_OVERRIDE;
void processedPendingEvents(bool didChange) Q_DECL_OVERRIDE;
void beginMacrostep() Q_DECL_OVERRIDE;
void endMacrostep(bool didChange) Q_DECL_OVERRIDE;
-#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
void enterStates(QEvent *event, const QList<QAbstractState*> &exitedStates_sorted,
const QList<QAbstractState*> &statesToEnter_sorted,
const QSet<QAbstractState*> &statesForDefaultEntry,
@@ -112,11 +110,9 @@ protected: // overrides for QStateMachinePrivate:
const QHash<QAbstractState*, QVector<QPropertyAssignment> > &assignmentsForEnteredStates) Q_DECL_OVERRIDE;
void exitInterpreter() Q_DECL_OVERRIDE;
-#endif // QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
void emitStateFinished(QState *forState, QFinalState *guiltyState) Q_DECL_OVERRIDE;
void startupHook() Q_DECL_OVERRIDE;
-#endif // QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
public: // fields
QScxmlStateMachine *m_stateMachine;
@@ -739,8 +735,6 @@ bool QScxmlInternal::WrappedQStateMachine::event(QEvent *e)
return QState::event(e);
}
-#if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
-
void QScxmlInternal::WrappedQStateMachinePrivate::noMicrostep()
{
qCDebug(qscxmlLog) << m_stateMachine
@@ -777,7 +771,6 @@ void QScxmlInternal::WrappedQStateMachinePrivate::endMacrostep(bool didChange)
}
}
-#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
void QScxmlInternal::WrappedQStateMachinePrivate::enterStates(
QEvent *event,
const QList<QAbstractState*> &exitedStates_sorted,
@@ -869,7 +862,6 @@ void QScxmlInternal::WrappedQStateMachinePrivate::exitInterpreter()
}
}
}
-#endif // QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
void QScxmlInternal::WrappedQStateMachinePrivate::emitStateFinished(QState *forState, QFinalState *guiltyState)
{
@@ -891,8 +883,6 @@ void QScxmlInternal::WrappedQStateMachinePrivate::startupHook()
q->submitQueuedEvents();
}
-#endif // QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
-
int QScxmlInternal::WrappedQStateMachinePrivate::eventIdForDelayedEvent(const QString &sendId)
{
QMutexLocker locker(&delayedEventsMutex);
diff --git a/tools/qscxmlc/scxmlcppdumper.cpp b/tools/qscxmlc/scxmlcppdumper.cpp
index 5f37ac8..a48a6b6 100644
--- a/tools/qscxmlc/scxmlcppdumper.cpp
+++ b/tools/qscxmlc/scxmlcppdumper.cpp
@@ -464,19 +464,7 @@ protected:
clazz.classFields << QStringLiteral("QScxmlTransition ") + tName + QLatin1Char(';');
// Initializer:
-#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0) // QTBUG-46703 work-around. See bug report why it's a bad one.
- QString parentName;
- auto parent = m_parents.last();
- if (HistoryState *historyState = parent->asHistoryState()) {
- parentName = QStringLiteral("state_") + mangledName(historyState) + QStringLiteral("_defaultConfiguration");
- } else {
- parentName = parentStateMemberName();
- }
- Q_ASSERT(!parentName.isEmpty());
- QString initializer = tName + QStringLiteral("(&") + parentName + QStringLiteral(", ");
-#else
QString initializer = tName + QStringLiteral("(");
-#endif
QStringList elements;
foreach (const QString &event, node->events)
elements.append(qba(event));
@@ -491,15 +479,11 @@ protected:
clazz.init.impl << tName + QStringLiteral(".setConditionalExpression(%1);").arg(cond);
}
-#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
if (m_parents.last()->asHistoryState()) {
clazz.init.impl << QStringLiteral("%1.setDefaultTransition(&%2);").arg(parentStateMemberName(), tName);
} else {
clazz.init.impl << QStringLiteral("%1.addTransitionTo(&%2);").arg(tName, parentStateMemberName());
}
-#else // QTBUG-46703: no default transition for QHistoryState yet...
- clazz.init.impl << parentName + QStringLiteral(".addTransition(&") + tName + QStringLiteral(");");
-#endif
if (node->type == Transition::Internal) {
clazz.init.impl << tName + QStringLiteral(".setTransitionType(QAbstractTransition::InternalTransition);");
@@ -554,21 +538,6 @@ protected:
// visit the kid:
if (Transition *t = node->defaultConfiguration()) {
-#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0) // work-around for QTBUG-46703
- // Declaration:
- clazz.classFields << QStringLiteral("QState ") + stateName + QStringLiteral("_defaultConfiguration;");
-
- // Initializer:
- QString init = stateName + QStringLiteral("_defaultConfiguration(&state_");
- if (State *parentState = node->parent->asState()) {
- init += mangledName(parentState);
- }
- clazz.constructor.initializer << init + QLatin1Char(')');
-
- // init:
- clazz.init.impl << stateName + QStringLiteral(".setDefaultState(&")
- + stateName + QStringLiteral("_defaultConfiguration);");
-#endif
m_parents.append(node);
t->accept(this);