summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Gaist <samuel.gaist@idiap.ch>2018-07-03 08:22:03 +0200
committerSamuel Gaist <samuel.gaist@idiap.ch>2018-07-03 21:41:13 +0000
commitccecdf14f9463cac13282ae3cf0f21dbe4aae4f3 (patch)
treed883caf0e0614e072d08af9982a85cb18e611ae7
parent179a8662f60bf86dc0734af192bfe41e332a5292 (diff)
Migrate QAxServerBase to QRegularExpression
This patch updates the QAxServerBase class to use QRegularExpression in place of QRegExp which is to be considered deprecated. Change-Id: I5f2a182bff583ff015fde71bfc164a5a27c5b1d3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r--src/activeqt/control/qaxserverbase.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/activeqt/control/qaxserverbase.cpp b/src/activeqt/control/qaxserverbase.cpp
index 22eb6b4..5d79a87 100644
--- a/src/activeqt/control/qaxserverbase.cpp
+++ b/src/activeqt/control/qaxserverbase.cpp
@@ -66,7 +66,7 @@
#include <qmenu.h>
#include <qmetaobject.h>
#include <qpixmap.h>
-#include <qregexp.h>
+#include <qregularexpression.h>
#include <qstatusbar.h>
#include <qwhatsthis.h>
#include <ocidl.h>
@@ -2395,11 +2395,13 @@ HRESULT WINAPI QAxServerBase::Invoke(DISPID dispidMember, REFIID riid,
}
// resolve overloads
if (index == -1) {
- QRegExp regexp(QLatin1String("_([0-9])\\("));
- if (regexp.lastIndexIn(QString::fromLatin1(name.constData())) != -1) {
- name.chop(regexp.cap(0).length());
+ QRegularExpression regexp(QLatin1String("_([0-9])\\("));
+ QRegularExpressionMatch rmatch;
+ QString::fromLatin1(name.constData()).lastIndexOf(regexp, -1, &rmatch);
+ if (rmatch.hasMatch()) {
+ name.chop(rmatch.capturedLength(0));
name += '(';
- int overload = regexp.cap(1).toInt() + 1;
+ int overload = rmatch.capturedRef(1).toInt() + 1;
for (int s = 0; s < qt.object->metaObject()->methodCount(); ++s) {
QMetaMethod slot = qt.object->metaObject()->method(s);