r24870 by craig - Qt6 build fix: More QRegExp replacements

scribus-commit scribus-commit at lists.scribus.net
Sun Jan 30 18:01:20 UTC 2022


Author: craig
Date: Sun Jan 30 18:01:20 2022
New Revision: 24870

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24870
Log:
Qt6 build fix: More QRegExp replacements

Modified:
    trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
    trunk/Scribus/scribus/plugins/import/odg/importodg.cpp
    trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp

Modified: trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24870&path=/trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp	(original)
+++ trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp	Sun Jan 30 18:01:20 2022
@@ -538,7 +538,7 @@
 	if (ui.eccCombo->currentIndex() != 0)
 	{
 		QString t = ui.eccCombo->currentText();
-		if (!opts.contains(QRegExp("\\beclevel=.*\\b")))
+		if (!opts.contains(QRegularExpression("\\beclevel=.*\\b")))
 			opts.append(" eclevel=" + t);
 		else
 			opts.replace(QRegularExpression("\\beclevel=\\S*\\b"), "eclevel=" + t);
@@ -557,37 +557,38 @@
 void BarcodeGenerator::updateUIFromOptionsText()
 {
 	ui.includetextCheck->blockSignals(true);
-	ui.includetextCheck->setChecked(ui.optionsEdit->text().contains(QRegExp("\\bincludetext\\b")));
+	ui.includetextCheck->setChecked(ui.optionsEdit->text().contains(QRegularExpression("\\bincludetext\\b")));
 	ui.includetextCheck->blockSignals(false);
 
 	ui.guardwhitespaceCheck->blockSignals(true);
-	ui.guardwhitespaceCheck->setChecked(ui.optionsEdit->text().contains(QRegExp("\\bguardwhitespace\\b")));
+	ui.guardwhitespaceCheck->setChecked(ui.optionsEdit->text().contains(QRegularExpression("\\bguardwhitespace\\b")));
 	ui.guardwhitespaceCheck->blockSignals(false);
 
 	ui.includecheckCheck->blockSignals(true);
-	ui.includecheckCheck->setChecked(ui.optionsEdit->text().contains(QRegExp("\\bincludecheck\\b")));
+	ui.includecheckCheck->setChecked(ui.optionsEdit->text().contains(QRegularExpression("\\bincludecheck\\b")));
 	ui.includecheckCheck->blockSignals(false);
 
 	ui.includecheckintextCheck->blockSignals(true);
-	ui.includecheckintextCheck->setChecked(ui.optionsEdit->text().contains(QRegExp("\\bincludecheckintext\\b")));
+	ui.includecheckintextCheck->setChecked(ui.optionsEdit->text().contains(QRegularExpression("\\bincludecheckintext\\b")));
 	ui.includecheckintextCheck->blockSignals(false);
 
 	ui.parseCheck->blockSignals(true);
-	ui.parseCheck->setChecked(ui.optionsEdit->text().contains(QRegExp("\\bparse\\b")));
+	ui.parseCheck->setChecked(ui.optionsEdit->text().contains(QRegularExpression("\\bparse\\b")));
 	ui.parseCheck->blockSignals(false);
 
 	ui.parsefncCheck->blockSignals(true);
-	ui.parsefncCheck->setChecked(ui.optionsEdit->text().contains(QRegExp("\\bparsefnc\\b")));
+	ui.parsefncCheck->setChecked(ui.optionsEdit->text().contains(QRegularExpression("\\bparsefnc\\b")));
 	ui.parsefncCheck->blockSignals(false);
 
 	QString enc = map[ui.bcCombo->currentText()].command;
 	QString vlbl = resvlbl.contains(enc) ? resvlbl[enc].toLower() : "version";
 
-	QRegExp rxf("\\b" + QRegExp::escape(vlbl) + "=(\\S*)\\b");
+	QRegularExpression rxf("\\b" + QRegularExpression::escape(vlbl) + "=(\\S*)\\b");
 	ui.formatCombo->blockSignals(true);
 	if (ui.optionsEdit->text().contains(rxf))
 	{
-		int idx = ui.formatCombo->findText(rxf.cap(1));
+		QRegularExpressionMatch match = rxf.match(ui.optionsEdit->text());
+		int idx = ui.formatCombo->findText(match.captured(1));
 		if (idx == -1)
 			idx = 0;
 		ui.formatCombo->setCurrentIndex(idx);
@@ -598,11 +599,12 @@
 	}
 	ui.formatCombo->blockSignals(false);
 
-	QRegExp rxe("\\beclevel=(\\S*)\\b");
+	QRegularExpression rxe("\\beclevel=(\\S*)\\b");
 	ui.eccCombo->blockSignals(true);
 	if (ui.optionsEdit->text().contains(rxe))
 	{
-		int idx=ui.eccCombo->findText(rxe.cap(1));
+		QRegularExpressionMatch match = rxe.match(ui.optionsEdit->text());
+		int idx=ui.eccCombo->findText(match.captured(1));
 		if (idx == -1)
 			idx = 0;
 		ui.eccCombo->setCurrentIndex(idx);

Modified: trunk/Scribus/scribus/plugins/import/odg/importodg.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24870&path=/trunk/Scribus/scribus/plugins/import/odg/importodg.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/odg/importodg.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/odg/importodg.cpp	Sun Jan 30 18:01:20 2022
@@ -1913,7 +1913,7 @@
 		QStringList subtransform = (*it).split('(', Qt::SkipEmptyParts);
 		subtransform[0] = subtransform[0].trimmed().toLower();
 		subtransform[1] = subtransform[1].simplified();
-		QRegExp reg("[,( ]");
+		QRegularExpression reg("[,( ]");
 		QStringList params = subtransform[1].split(reg, Qt::SkipEmptyParts);
 		if (subtransform[0].startsWith(";") || subtransform[0].startsWith(","))
 			subtransform[0] = subtransform[0].right(subtransform[0].length() - 1);
@@ -1951,7 +1951,7 @@
 		QStringList subtransform = (*it).split('(', Qt::SkipEmptyParts);
 		subtransform[0] = subtransform[0].trimmed().toLower();
 		subtransform[1] = subtransform[1].simplified();
-		QRegExp reg("[,( ]");
+		QRegularExpression reg("[,( ]");
 		QStringList params = subtransform[1].split(reg, Qt::SkipEmptyParts);
 		if (subtransform[0].startsWith(";") || subtransform[0].startsWith(","))
 			subtransform[0] = subtransform[0].right(subtransform[0].length() - 1);

Modified: trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24870&path=/trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp	(original)
+++ trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp	Sun Jan 30 18:01:20 2022
@@ -1407,7 +1407,7 @@
 		QStringList subtransform = (*it).split('(', Qt::SkipEmptyParts);
 		subtransform[0] = subtransform[0].trimmed().toLower();
 		subtransform[1] = subtransform[1].simplified();
-		QRegExp reg("[,( ]");
+		QRegularExpression reg("[,( ]");
 		QStringList params = subtransform[1].split(reg, Qt::SkipEmptyParts);
 		if (subtransform[0].startsWith(";") || subtransform[0].startsWith(","))
 			subtransform[0] = subtransform[0].right(subtransform[0].length() - 1);




More information about the scribus-commit mailing list