summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.qmake.conf4
-rw-r--r--src/scxml/qscxmlstatemachine.cpp18
-rw-r--r--src/scxml/qscxmlstatemachine.h1
-rw-r--r--src/scxml/qscxmlstatemachine_p.h1
-rw-r--r--src/scxml/qscxmlstatemachineinfo.cpp4
-rw-r--r--tools/qscxmlc/generator.cpp16
-rw-r--r--tools/qscxmlc/scxmlcppdumper.cpp4
7 files changed, 28 insertions, 20 deletions
diff --git a/.qmake.conf b/.qmake.conf
index 230f0b6..18bd95e 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -2,4 +2,6 @@ load(qt_build_config)
CONFIG += qt_example_installs
CONFIG += warning_clean
-MODULE_VERSION = 5.13.1
+DEFINES += QT_NO_FOREACH QT_NO_JAVA_STYLE_ITERATORS QT_NO_LINKED_LIST
+
+MODULE_VERSION = 5.14.0
diff --git a/src/scxml/qscxmlstatemachine.cpp b/src/scxml/qscxmlstatemachine.cpp
index b7431ba..23f8a71 100644
--- a/src/scxml/qscxmlstatemachine.cpp
+++ b/src/scxml/qscxmlstatemachine.cpp
@@ -768,6 +768,7 @@ void QScxmlStateMachinePrivate::attach(QScxmlStateMachineInfo *info)
void QScxmlStateMachinePrivate::updateMetaCache()
{
m_stateIndexToSignalIndex.clear();
+ m_stateNameToSignalIndex.clear();
if (!m_tableData)
return;
@@ -776,10 +777,14 @@ void QScxmlStateMachinePrivate::updateMetaCache()
return;
int signalIndex = 0;
+ const int methodOffset = QMetaObjectPrivate::signalOffset(m_metaObject);
for (int i = 0; i < m_stateTable->stateCount; ++i) {
const auto &s = m_stateTable->state(i);
if (!s.isHistoryState() && s.type != StateTable::State::Invalid) {
m_stateIndexToSignalIndex.insert(i, signalIndex);
+ m_stateNameToSignalIndex.insert(m_tableData->string(s.name),
+ signalIndex + methodOffset);
+
++signalIndex;
}
}
@@ -1095,7 +1100,8 @@ void QScxmlStateMachinePrivate::exitStates(const OrderedSet &enabledTransitions)
if (m_infoSignalProxy) {
emit m_infoSignalProxy->statesExited(
- QVector<QScxmlStateMachineInfo::StateId>::fromStdVector(statesToExitSorted));
+ QVector<QScxmlStateMachineInfo::StateId>(statesToExitSorted.begin(),
+ statesToExitSorted.end()));
}
}
@@ -1126,8 +1132,8 @@ void QScxmlStateMachinePrivate::executeTransitionContent(const OrderedSet &enabl
if (m_infoSignalProxy) {
emit m_infoSignalProxy->transitionsTriggered(
- QVector<QScxmlStateMachineInfo::TransitionId>::fromStdVector(
- enabledTransitions.list()));
+ QVector<QScxmlStateMachineInfo::TransitionId>(enabledTransitions.list().begin(),
+ enabledTransitions.list().end()));
}
}
@@ -1190,7 +1196,8 @@ void QScxmlStateMachinePrivate::enterStates(const OrderedSet &enabledTransitions
emitStateActive(s, true);
if (m_infoSignalProxy) {
emit m_infoSignalProxy->statesEntered(
- QVector<QScxmlStateMachineInfo::StateId>::fromStdVector(sortedStates));
+ QVector<QScxmlStateMachineInfo::StateId>(sortedStates.begin(),
+ sortedStates.end()));
}
}
@@ -1907,8 +1914,7 @@ QMetaObject::Connection QScxmlStateMachine::connectToStateImpl(const QString &sc
types = QtPrivate::ConnectionTypes<QtPrivate::List<bool> >::types();
Q_D(QScxmlStateMachine);
- int signalIndex = QScxmlInternal::signalIndex(d->m_metaObject,
- scxmlStateName.toUtf8() + "Changed(bool)");
+ const int signalIndex = d->m_stateNameToSignalIndex.value(scxmlStateName);
return signalIndex < 0 ? QMetaObject::Connection()
: QObjectPrivate::connectImpl(this, signalIndex, receiver, slot, slotObj,
type, types, d->m_metaObject);
diff --git a/src/scxml/qscxmlstatemachine.h b/src/scxml/qscxmlstatemachine.h
index 090a1b6..a0a4e8b 100644
--- a/src/scxml/qscxmlstatemachine.h
+++ b/src/scxml/qscxmlstatemachine.h
@@ -41,7 +41,6 @@
#define QSCXMLSTATEMACHINE_H
#include <QtScxml/qscxmldatamodel.h>
-#include <QtScxml/qscxmlexecutablecontent.h>
#include <QtScxml/qscxmlerror.h>
#include <QtScxml/qscxmlevent.h>
#include <QtScxml/qscxmlcompiler.h>
diff --git a/src/scxml/qscxmlstatemachine_p.h b/src/scxml/qscxmlstatemachine_p.h
index aa08f1c..1c354fa 100644
--- a/src/scxml/qscxmlstatemachine_p.h
+++ b/src/scxml/qscxmlstatemachine_p.h
@@ -382,6 +382,7 @@ private:
QScxmlInternal::StateMachineInfoProxy *m_infoSignalProxy;
QHash<int, int> m_stateIndexToSignalIndex;
+ QHash<QString, int> m_stateNameToSignalIndex;
};
QT_END_NAMESPACE
diff --git a/src/scxml/qscxmlstatemachineinfo.cpp b/src/scxml/qscxmlstatemachineinfo.cpp
index d81956a..4fbbecf 100644
--- a/src/scxml/qscxmlstatemachineinfo.cpp
+++ b/src/scxml/qscxmlstatemachineinfo.cpp
@@ -242,8 +242,8 @@ QVector<QString> QScxmlStateMachineInfo::transitionEvents(TransitionId transitio
QVector<QScxmlStateMachineInfo::StateId> QScxmlStateMachineInfo::configuration() const
{
Q_D(const QScxmlStateMachineInfo);
-
- return QVector<StateId>::fromStdVector(d->stateMachinePrivate()->configuration().list());
+ const auto &list = d->stateMachinePrivate()->configuration().list();
+ return QVector<StateId>(list.cbegin(), list.cend());
}
QT_END_NAMESPACE
diff --git a/tools/qscxmlc/generator.cpp b/tools/qscxmlc/generator.cpp
index ea3a066..6febf09 100644
--- a/tools/qscxmlc/generator.cpp
+++ b/tools/qscxmlc/generator.cpp
@@ -172,7 +172,7 @@ bool Generator::registerableMetaType(const QByteArray &propertyType)
#undef STREAM_SMART_POINTER
;
- foreach (const QByteArray &smartPointer, smartPointers)
+ for (const QByteArray &smartPointer : smartPointers)
if (propertyType.startsWith(smartPointer + "<") && !propertyType.endsWith("&"))
return knownQObjectClasses.contains(propertyType.mid(smartPointer.size() + 1, propertyType.size() - smartPointer.size() - 1 - 1));
@@ -181,7 +181,7 @@ bool Generator::registerableMetaType(const QByteArray &propertyType)
QT_FOR_EACH_AUTOMATIC_TEMPLATE_1ARG(STREAM_1ARG_TEMPLATE)
#undef STREAM_1ARG_TEMPLATE
;
- foreach (const QByteArray &oneArgTemplateType, oneArgTemplates)
+ for (const QByteArray &oneArgTemplateType : oneArgTemplates)
if (propertyType.startsWith(oneArgTemplateType + "<") && propertyType.endsWith(">")) {
const int argumentSize = propertyType.size() - oneArgTemplateType.size() - 1
// The closing '>'
@@ -1202,8 +1202,8 @@ void Generator::generateStaticMetacall()
fprintf(out, " case %d:\n", it.key());
fprintf(out, " switch (*reinterpret_cast<int*>(_a[1])) {\n");
fprintf(out, " default: *reinterpret_cast<int*>(_a[0]) = -1; break;\n");
- foreach (const QByteArray &key, it->uniqueKeys()) {
- foreach (int argumentID, it->values(key))
+ for (const QByteArray &key : it->uniqueKeys()) {
+ for (int argumentID : it->values(key))
fprintf(out, " case %d:\n", argumentID);
fprintf(out, " *reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< %s >(); break;\n", key.constData());
}
@@ -1268,8 +1268,8 @@ void Generator::generateStaticMetacall()
fprintf(out, "if (_c == QMetaObject::RegisterPropertyMetaType) {\n");
fprintf(out, " switch (_id) {\n");
fprintf(out, " default: *reinterpret_cast<int*>(_a[0]) = -1; break;\n");
- foreach (const QByteArray &key, automaticPropertyMetaTypes.uniqueKeys()) {
- foreach (int propertyID, automaticPropertyMetaTypes.values(key))
+ for (const QByteArray &key : automaticPropertyMetaTypes.uniqueKeys()) {
+ for (int propertyID : automaticPropertyMetaTypes.values(key))
fprintf(out, " case %d:\n", propertyID);
fprintf(out, " *reinterpret_cast<int*>(_a[0]) = qRegisterMetaType< %s >(); break;\n", key.constData());
}
@@ -1593,8 +1593,8 @@ void Generator::generatePluginMetaData()
data.insert(QStringLiteral("MetaData"), cdef->pluginData.metaData.object());
// Add -M args from the command line:
- foreach (const QString &key, cdef->pluginData.metaArgs.keys())
- data.insert(key, cdef->pluginData.metaArgs.value(key));
+ for (auto it = cdef->pluginData.metaArgs.cbegin(), end = cdef->pluginData.metaArgs.cend(); it != end; ++it)
+ data.insert(it.key(), it.value());
fputs("\nQT_PLUGIN_METADATA_SECTION const uint qt_section_alignment_dummy = 42;\n\n"
"#ifdef QT_NO_DEBUG\n", out);
diff --git a/tools/qscxmlc/scxmlcppdumper.cpp b/tools/qscxmlc/scxmlcppdumper.cpp
index 89a403b..4f62039 100644
--- a/tools/qscxmlc/scxmlcppdumper.cpp
+++ b/tools/qscxmlc/scxmlcppdumper.cpp
@@ -676,11 +676,11 @@ QString CppDumper::mangleIdentifier(const QString &str)
}
for (int ei = str.length(); i != ei; ++i) {
- auto c = str.at(i).unicode();
+ auto c = str.at(i);
if ((c >= QLatin1Char('0') && c <= QLatin1Char('9')) || isNonDigit(c)) {
mangled += c;
} else {
- mangled += QLatin1String("_0x") + QString::number(c, 16) + QLatin1Char('_');
+ mangled += QLatin1String("_0x") + QString::number(c.unicode(), 16) + QLatin1Char('_');
}
}