mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 23:25:53 +08:00
Replace QRegExp with QRegularExpression
Reviewers: kbasan, msutcliffe Reviewed By: kbasan, msutcliffe Subscribers: jenkins Differential Revision: https://dev.swift-project.org/D11
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
#include <QPlainTextEdit>
|
||||
#include <QPushButton>
|
||||
#include <QRadioButton>
|
||||
#include <QRegExp>
|
||||
#include <QRegularExpression>
|
||||
#include <QTabBar>
|
||||
#include <QCompleter>
|
||||
#include <Qt>
|
||||
@@ -270,9 +270,9 @@ namespace BlackGui
|
||||
flightPlan.setTakeoffTimePlanned(v);
|
||||
}
|
||||
|
||||
static const QRegExp withUnit("\\D+");
|
||||
thread_local const QRegularExpression withUnit("\\D+");
|
||||
v = ui->le_CrusingAltitude->text().trimmed();
|
||||
if (!v.isEmpty() && withUnit.indexIn(v) < 0)
|
||||
if (!v.isEmpty() && !withUnit.match(v).hasMatch())
|
||||
{
|
||||
v += "ft";
|
||||
ui->le_CrusingAltitude->setText(v);
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackconfig/buildconfig.h"
|
||||
|
||||
#include <QRegularExpression>
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Simulation;
|
||||
using namespace BlackMisc::Simulation::FsCommon;
|
||||
@@ -176,7 +178,7 @@ namespace BlackGui
|
||||
const QString raw = rawString.trimmed();
|
||||
if (raw.isEmpty()) { return QStringList(); }
|
||||
QStringList dirs;
|
||||
const QStringList rawLines = raw.split(QRegExp("\n|\r\n|\r"));
|
||||
const QStringList rawLines = raw.split(QRegularExpression("\n|\r\n|\r"));
|
||||
for (const QString &l : rawLines)
|
||||
{
|
||||
const QString normalized = CFileUtils::normalizeFilePathToQtStandard(l);
|
||||
|
||||
@@ -229,10 +229,10 @@ namespace BlackGui
|
||||
|
||||
void CWeatherComponent::setupInputValidators()
|
||||
{
|
||||
QRegExp reIcaoOrLatitude("^[a-zA-Z]{4}|-?\\d{1,2}[,.]?\\d+$", Qt::CaseInsensitive);
|
||||
ui->le_LatOrIcao->setValidator(new QRegExpValidator(reIcaoOrLatitude, this));
|
||||
QRegExp reLongitude("^-?\\d{1,2}[,.]?\\d+$", Qt::CaseInsensitive);
|
||||
ui->le_Lon->setValidator(new QRegExpValidator(reLongitude, this));
|
||||
QRegularExpression reIcaoOrLatitude("^[a-zA-Z]{4}|-?\\d{1,2}[,.]?\\d+$", QRegularExpression::CaseInsensitiveOption);
|
||||
ui->le_LatOrIcao->setValidator(new QRegularExpressionValidator(reIcaoOrLatitude, this));
|
||||
QRegularExpression reLongitude("^-?\\d{1,2}[,.]?\\d+$", QRegularExpression::CaseInsensitiveOption);
|
||||
ui->le_Lon->setValidator(new QRegularExpressionValidator(reLongitude, this));
|
||||
}
|
||||
|
||||
void CWeatherComponent::setupCompleter()
|
||||
|
||||
Reference in New Issue
Block a user