r24861 by craig - Qt6 build fix for QRegExp

scribus-commit scribus-commit at lists.scribus.net
Sun Jan 30 15:44:44 UTC 2022


Author: craig
Date: Sun Jan 30 15:44:44 2022
New Revision: 24861

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

Modified:
    trunk/Scribus/scribus/styles/style.cpp

Modified: trunk/Scribus/scribus/styles/style.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24861&path=/trunk/Scribus/scribus/styles/style.cpp
==============================================================================
--- trunk/Scribus/scribus/styles/style.cpp	(original)
+++ trunk/Scribus/scribus/styles/style.cpp	Sun Jan 30 15:44:44 2022
@@ -14,6 +14,7 @@
 ***************************************************************************/
 
 #include <QDebug>
+#include <QRegularExpression>
 
 #include "style.h"
 #include "desaxe/digester.h"
@@ -64,10 +65,11 @@
 	if (m_name.isEmpty())
 		return QString();
 
-	static QRegExp rx("^(.*)\\s+\\((\\d+)\\)$");
-	if (rx.indexIn(m_name) != -1)
+	static QRegularExpression rx("^(.*)\\s+\\((\\d+)\\)$");
+	QRegularExpressionMatch match = rx.match(m_name);
+	if (match.hasMatch())
 	{
-		QStringList matches = rx.capturedTexts();
+		QStringList matches = match.capturedTexts();
 		if (matches.count() >= 3)
 			return matches[1];
 	}




More information about the scribus-commit mailing list