Le 13/02/2023 à 11:58, Jean-Marc Lasgouttes a écrit :
Le 12/02/2023 à 22:04, Scott Kostyshak a écrit :
On Sun, Feb 12, 2023 at 09:35:19PM +0100, Jean-Marc Lasgouttes wrote:
Le 12/02/2023 à 21:08, Scott Kostyshak a écrit :
Master branch

I see. Indeed it seems there's still instances of it. I wonder if in
earlier Qt 6 versions it was a warning so that is why it used to work?

Is there a reason why we could not get rid of QRegExp now that Qt4 is gone?

I think someone just has to do the work. For example, 635a7d77 suggests
that it is not trivial.

The example we see here is in support/qstring_helpers.cpp. It should be trivial enough.

What I do not know though is whether
1/ there are other places
2/ QRegularExpression is good enough with early Qt5 version (not that we care much about them, actually).

This compiles fine, but I'd rather wait for Kornel, who is our local QRegExp expert.

JMarc


diff --git a/src/support/qstring_helpers.cpp b/src/support/qstring_helpers.cpp
index fadca76a65..e39dc7fb33 100644
--- a/src/support/qstring_helpers.cpp
+++ b/src/support/qstring_helpers.cpp
@@ -18,7 +18,7 @@
 #include "support/docstring.h"
 #include "support/qstring_helpers.h"
 
-#include <QRegExp>
+#include <QRegularExpression>
 #include <QLocale>
 #include <QString>
 #include <QVector>
@@ -83,9 +83,10 @@ QString charFilterRegExp(QString const & filter)
 	QString re = ".*";
 	for (QChar const & c : filter) {
 		if (c.isLower())
-			re +=  "["+ QRegExp::escape(c) + QRegExp::escape(c.toUpper()) + "]";
+			re +=  "[" + QRegularExpression::escape(c)
+			           + QRegularExpression::escape(c.toUpper()) + "]";
 		else
-			re +=  QRegExp::escape(c);
+			re +=  QRegularExpression::escape(c);
 	}
 	return re;
 }
@@ -95,9 +96,10 @@ QString charFilterRegExpC(QString const & filter)
 	QString re = "(";
 	for (QChar const & c : filter) {
 		if (c.isLower())
-			re +=  "["+ QRegExp::escape(c) + QRegExp::escape(c.toUpper()) + "]";
+			re +=  "[" + QRegularExpression::escape(c)
+		               + QRegularExpression::escape(c.toUpper()) + "]";
 		else
-			re +=  QRegExp::escape(c);
+			re +=  QRegularExpression::escape(c);
 	}
 	return re + ")";
 }
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to