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
+6
-6
@@ -48,7 +48,7 @@
|
||||
#include <QtWidgets/QTreeView>
|
||||
#include <QtWidgets/QHBoxLayout>
|
||||
#include <QtWidgets/QDialog>
|
||||
#include <QtCore/QRegExp>
|
||||
#include <QtCore/QRegularExpression>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QThread>
|
||||
#include <QtGui/QPainter>
|
||||
@@ -211,12 +211,12 @@ QStringList listOfPlanEditorSidcs_Internal()
|
||||
|
||||
|
||||
// helper function
|
||||
bool check(QRegExp ®Exp, const QStringList ®ExStrings, const QString &token)
|
||||
bool check(QRegularExpression ®Exp, const QStringList ®ExStrings, const QString &token)
|
||||
{
|
||||
for (const QString &rgExStr : regExStrings)
|
||||
{
|
||||
regExp.setPattern(rgExStr);
|
||||
if (regExp.exactMatch(token))
|
||||
if (regExp.match(token).hasMatch())
|
||||
return true;
|
||||
if (token.contains(rgExStr, Qt::CaseInsensitive))
|
||||
return true;
|
||||
@@ -225,10 +225,10 @@ bool check(QRegExp ®Exp, const QStringList ®ExStrings, const QString &toke
|
||||
}
|
||||
|
||||
// helper function
|
||||
bool check(QRegExp ®Exp, const QString ®ExString, const QString &token)
|
||||
bool check(QRegularExpression ®Exp, const QString ®ExString, const QString &token)
|
||||
{
|
||||
regExp.setPattern(regExString);
|
||||
if (regExp.exactMatch(token))
|
||||
if (regExp.match(token).hasMatch())
|
||||
return true;
|
||||
if (token.contains(regExString))
|
||||
return true;
|
||||
@@ -2203,7 +2203,7 @@ QList<ModifierData> SymbolDictionaryImpl::symbolModifierList(const QString &base
|
||||
|
||||
// check baseSymbolCode, must contains 8 digits
|
||||
|
||||
if (!QRegExp(QStringLiteral("^[0-9]{8,8}$")).exactMatch(baseSymbolCode))
|
||||
if (!QRegularExpression(QStringLiteral("^[0-9]{8,8}$")).match(baseSymbolCode).hasMatch())
|
||||
{
|
||||
ERROR_LOG(m_logger) << LOGFUNCTION << " Invalid baseSymbolCode \"" << baseSymbolCode << "\". Must be made up of 8 digits.";
|
||||
return QList<ModifierData>();
|
||||
|
||||
Reference in new issue
Block a user