Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Fix Qt5 build

Freya Lupen3c8dceb4fb14
diff --git a/libs/pigment/KoColor.cpp b/libs/pigment/KoColor.cpp
index 3a63a474a4..2e3fc90749 100644
--- a/libs/pigment/KoColor.cpp
+++ b/libs/pigment/KoColor.cpp
@@ -545,7 +545,9 @@ KoColor KoColor::fromSVG11(const QString value, QHash<QString, const KoColorProf
QStringList colorDefinitions;
QString valueAdjust = value.split(";").first();
valueAdjust.append(" ");
- for (const QRegularExpressionMatch &match : splitDefinitions.globalMatch(valueAdjust)) {
+ QRegularExpressionMatchIterator i = splitDefinitions.globalMatch(valueAdjust);
+ while (i.hasNext()) {
+ QRegularExpressionMatch match = i.next();
colorDefinitions.append(match.captured(1).trimmed());
pos = match.capturedEnd(0);
}
diff --git a/libs/ui/kis_animation_importer.cpp b/libs/ui/kis_animation_importer.cpp
index 6203a7bd9a..1cf7779a2c 100644
--- a/libs/ui/kis_animation_importer.cpp
+++ b/libs/ui/kis_animation_importer.cpp
@@ -88,7 +88,9 @@ KisImportExportErrorCode KisAnimationImporter::import(QStringList files, int fir
const QRegularExpression rx(QLatin1String("(\\d+)")); //regex for extracting numbers
QStringList fileNumberRxList;
- for (const QRegularExpressionMatch &match : rx.globalMatch(files.at(0))) {
+ QRegularExpressionMatchIterator i = rx.globalMatch(files.at(0));
+ while (i.hasNext()) {
+ QRegularExpressionMatch match = i.next();
fileNumberRxList << match.captured(1);
}
@@ -146,7 +148,9 @@ KisImportExportErrorCode KisAnimationImporter::import(QStringList files, int fir
if (!autoAddHoldframes) {
layerRasterChannelPair.second->importFrame(frame, importDoc->image()->projection(), NULL); // as first frame added will go to second slot i.e #1 instead of #0
} else {
- for (const QRegularExpressionMatch &match : rx.globalMatch(file)) {
+ QRegularExpressionMatchIterator i = rx.globalMatch(file);
+ while (i.hasNext()) {
+ QRegularExpressionMatch match = i.next();
fileNumberRxList << match.captured(1);
}
diff --git a/plugins/tools/svgtexttool/BasicXMLSyntaxHighlighter.cpp b/plugins/tools/svgtexttool/BasicXMLSyntaxHighlighter.cpp
index 055bbc9e6c..371d122795 100644
--- a/plugins/tools/svgtexttool/BasicXMLSyntaxHighlighter.cpp
+++ b/plugins/tools/svgtexttool/BasicXMLSyntaxHighlighter.cpp
@@ -35,7 +35,9 @@ BasicXMLSyntaxHighlighter::BasicXMLSyntaxHighlighter(QTextEdit * parent) :
void BasicXMLSyntaxHighlighter::highlightBlock(const QString & text)
{
// Special treatment for xml element regex as we use captured text to emulate lookbehind
- for (const QRegularExpressionMatch &match : m_xmlElementRegex.globalMatch(text)) {
+ QRegularExpressionMatchIterator i = m_xmlElementRegex.globalMatch(text);
+ while (i.hasNext()) {
+ QRegularExpressionMatch match = i.next();
setFormat(match.capturedStart(0), match.capturedLength(0), m_xmlElementFormat);
}
@@ -55,7 +57,9 @@ void BasicXMLSyntaxHighlighter::highlightBlock(const QString & text)
void BasicXMLSyntaxHighlighter::highlightByRegex(const QTextCharFormat & format,
const QRegularExpression & regex, const QString & text)
{
- for (const QRegularExpressionMatch &match : regex.globalMatch(text)) {
+ QRegularExpressionMatchIterator i = regex.globalMatch(text);
+ while (i.hasNext()) {
+ QRegularExpressionMatch match = i.next();
setFormat(match.capturedStart(0), match.capturedLength(0), format);
}
}