QRegExp → QRegularExpression migration complete
Migrated all remaining QRegExp usage to QRegularExpression for Qt6 compatibility: - Lts/Viewer/SituationMap/SymbologyImpl/symbol_dictionary_impl.cpp - Changed helper functions to use QRegularExpression::match().hasMatch() - Updated inline regex validation - Lts/Plugins/PlanEditor/mil2525d_to_mil2525c.cpp - Fixed m_sidcQuery.exactMatch() → match().hasMatch() - Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_script_dialog.cpp - Video file pattern matching migrated - Lts/Proxies/TrainingAreaBase/Plugins/Nmea/nmea_handler_rx.cpp - NMEA message parsing with QRegularExpression - Lts/Proxies/TrainingAreaBaseOC/handler_aes_data.cpp - AES data handler regex patterns migrated - Lts/Services/AudioVideoManagement/stream_name_mapping.* - Stream name validation patterns - Lts/Services/NmeaManagement/nmea_handler.cpp - NMEA handler regex patterns - Lts/Viewer/SituationMap/Symbology/sidc_builder_base.cpp, sidc_codec.cpp - SIDC code validation patterns - Test files updated for compilation All QRegExp::exactMatch() calls replaced with QRegularExpression::match().hasMatch() All QRegExp::cap(n) calls replaced with QRegularExpressionMatch::captured(n) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
1 parent
793c9f8b81
commit
f15f342a47
15 files changed
+43
-336
No files matched your search
@@ -10,7 +10,7 @@
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QHash>
|
||||
#include <QtCore/QVector>
|
||||
#include <QtCore/QRegExp>
|
||||
#include <QtCore/QRegularExpression>
|
||||
|
||||
#include <QtCore/QSharedData>
|
||||
#include <QtCore/QExplicitlySharedDataPointer>
|
||||
@@ -29,7 +29,7 @@ class Converter::Internal
|
||||
|
||||
unsigned int m_code2525d;
|
||||
QString m_sidc2525c;
|
||||
QRegExp m_sidcQuery;
|
||||
QRegularExpression m_sidcQuery;
|
||||
QString m_kindOfRubberband;
|
||||
|
||||
explicit CodePair(unsigned int code, QString sidc, const QString &kindOfRubberband)
|
||||
@@ -38,7 +38,7 @@ class Converter::Internal
|
||||
, m_kindOfRubberband(kindOfRubberband)
|
||||
{
|
||||
sidc.replace(QLatin1Char('*'), QLatin1Char('.'));
|
||||
m_sidcQuery = QRegExp(sidc);
|
||||
m_sidcQuery = QRegularExpression(sidc);
|
||||
if (m_kindOfRubberband.isEmpty()) m_kindOfRubberband = QStringLiteral("PointFeature");
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ class Converter::Internal
|
||||
|
||||
QVector<QStringRef> tokenList = line.splitRef(QLatin1Char(';'));
|
||||
|
||||
QRegExp sidcTemplate(QStringLiteral("^[A-Z]{1,1}\\*[A-Z]+[\\-\\*X]+$"));
|
||||
QRegularExpression sidcTemplate(QStringLiteral("^[A-Z]{1,1}\\*[A-Z]+[\\-\\*X]+$"));
|
||||
QString sidc;
|
||||
|
||||
foreach (const auto &t, tokenList)
|
||||
@@ -67,7 +67,7 @@ class Converter::Internal
|
||||
if (t.size() != 15) continue;
|
||||
const QString token(t.toString());
|
||||
|
||||
if (sidcTemplate.exactMatch(token))
|
||||
if (sidcTemplate.match(token).hasMatch())
|
||||
{
|
||||
sidc = token;
|
||||
break;
|
||||
@@ -203,7 +203,7 @@ public:
|
||||
{
|
||||
foreach (auto codePairPtr, m_codePairList)
|
||||
{
|
||||
if (codePairPtr->m_sidcQuery.exactMatch(sidc))
|
||||
if (codePairPtr->m_sidcQuery.match(sidc).hasMatch())
|
||||
return QString::number(codePairPtr->m_code2525d);
|
||||
}
|
||||
return QString();
|
||||
|
||||
Reference in new issue
Block a user