diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2020-02-25 15:38:59 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2020-03-02 15:57:40 +0100 |
commit | 61ed1a9e09fe54b0d52afbf865de03c8c4eaed82 (patch) | |
tree | 6b527ac4923ad930673a1bc09eab03f50794b9b7 | |
parent | 78eac0c12128ed1884b0c35e1191a9646df60a3d (diff) |
Use Qt::SplitBehavior in preference to QString::SplitBehavior
The Qt version was added in 5.14 "for use as eventual replacement for
QString::SplitBehavior." Move another step closer to that goal.
Change-Id: I022d0c59b1fce62378a89c8f4087aaf99d3aac8c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r-- | src/scxml/qscxmlcompiler.cpp | 12 | ||||
-rw-r--r-- | tests/auto/parser/tst_parser.cpp | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/scxml/qscxmlcompiler.cpp b/src/scxml/qscxmlcompiler.cpp index 36967d1..76c70d8 100644 --- a/src/scxml/qscxmlcompiler.cpp +++ b/src/scxml/qscxmlcompiler.cpp @@ -1404,7 +1404,7 @@ bool QScxmlCompilerPrivate::preReadElementScxml() const QXmlStreamAttributes attributes = m_reader->attributes(); if (attributes.hasAttribute(QStringLiteral("initial"))) { const QString initial = attributes.value(QStringLiteral("initial")).toString(); - scxml->initial += initial.split(QChar::Space, QString::SkipEmptyParts); + scxml->initial += initial.split(QChar::Space, Qt::SkipEmptyParts); } const QStringRef datamodel = attributes.value(QLatin1String("datamodel")); @@ -1460,7 +1460,7 @@ bool QScxmlCompilerPrivate::preReadElementState() if (attributes.hasAttribute(QStringLiteral("initial"))) { const QString initial = attributes.value(QStringLiteral("initial")).toString(); - newState->initial += initial.split(QChar::Space, QString::SkipEmptyParts); + newState->initial += initial.split(QChar::Space, Qt::SkipEmptyParts); } m_currentState = newState; return true; @@ -1525,8 +1525,8 @@ bool QScxmlCompilerPrivate::preReadElementTransition() } const QXmlStreamAttributes attributes = m_reader->attributes(); - transition->events = attributes.value(QLatin1String("event")).toString().split(QLatin1Char(' '), QString::SkipEmptyParts); - transition->targets = attributes.value(QLatin1String("target")).toString().split(QLatin1Char(' '), QString::SkipEmptyParts); + transition->events = attributes.value(QLatin1String("event")).toString().split(QLatin1Char(' '), Qt::SkipEmptyParts); + transition->targets = attributes.value(QLatin1String("target")).toString().split(QLatin1Char(' '), Qt::SkipEmptyParts); if (attributes.hasAttribute(QStringLiteral("cond"))) transition->condition.reset(new QString(attributes.value(QLatin1String("cond")).toString())); QStringRef type = attributes.value(QLatin1String("type")); @@ -1813,7 +1813,7 @@ bool QScxmlCompilerPrivate::preReadElementSend() send->target = attributes.value(QLatin1String("target")).toString(); send->targetexpr = attributes.value(QLatin1String("targetexpr")).toString(); if (attributes.hasAttribute(QLatin1String("namelist"))) - send->namelist = attributes.value(QLatin1String("namelist")).toString().split(QLatin1Char(' '), QString::SkipEmptyParts); + send->namelist = attributes.value(QLatin1String("namelist")).toString().split(QLatin1Char(' '), Qt::SkipEmptyParts); current().instruction = send; return true; } @@ -1854,7 +1854,7 @@ bool QScxmlCompilerPrivate::preReadElementInvoke() invoke->autoforward = true; else invoke->autoforward = false; - invoke->namelist = attributes.value(QLatin1String("namelist")).toString().split(QLatin1Char(' '), QString::SkipEmptyParts); + invoke->namelist = attributes.value(QLatin1String("namelist")).toString().split(QLatin1Char(' '), Qt::SkipEmptyParts); current().instruction = invoke; return true; } diff --git a/tests/auto/parser/tst_parser.cpp b/tests/auto/parser/tst_parser.cpp index 22b9059..203dfaa 100644 --- a/tests/auto/parser/tst_parser.cpp +++ b/tests/auto/parser/tst_parser.cpp @@ -65,7 +65,7 @@ void tst_Parser::error() QFile errorFile(errorFileName); errorFile.open(QIODevice::ReadOnly | QIODevice::Text); const QStringList expectedErrors = - QString::fromUtf8(errorFile.readAll()).split('\n', QString::SkipEmptyParts); + QString::fromUtf8(errorFile.readAll()).split('\n', Qt::SkipEmptyParts); if (!expectedErrors.isEmpty()) QTest::ignoreMessage(QtWarningMsg, "SCXML document has errors"); |