From b5ae1237e33d27b6acad5b6bb301b5bf1ec0ab50 Mon Sep 17 00:00:00 2001 From: Simon De Backer Date: Wed, 23 Sep 2020 21:36:48 +0200 Subject: [PATCH] Fix QRegularExpression -add isValid -add debug --- .../ElementsCollection/elementslocation.cpp | 3 ++- sources/titleblock/templatelocation.cpp | 26 ++++++++++++++----- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/sources/ElementsCollection/elementslocation.cpp b/sources/ElementsCollection/elementslocation.cpp index addbf8e85..0baede257 100644 --- a/sources/ElementsCollection/elementslocation.cpp +++ b/sources/ElementsCollection/elementslocation.cpp @@ -253,7 +253,8 @@ void ElementsLocation::setPath(const QString &path) QRegularExpressionMatch match = re.match(tmp_path); if (!match.hasMatch()) { - qDebug()<<"no Match => return"; + qDebug()<<"no Match => return" + <.*)"); + if (!name_from_url.isValid()) + { + qWarning() <<"this is an error in the code" + << name_from_url.errorString() + << name_from_url.patternErrorOffset(); + return; } + + QRegularExpressionMatch match = name_from_url.match(loc_str); + if (!match.hasMatch()) + { + qDebug()<<"no Match => return" + <