forked from qt-creator/qt-creator
Port from QRegExpValidator to QRegularExpressionValidator
QRegExpValidator is going away in Qt6, so port over to the version using QRegularExpression. Change-Id: Iecd1ba1f0e5e01009ae43b79c1ccc73f0fc046b2 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -37,7 +37,7 @@
|
||||
#include <QDateTime>
|
||||
#include <QDir>
|
||||
#include <QPushButton>
|
||||
#include <QRegExpValidator>
|
||||
#include <QRegularExpressionValidator>
|
||||
#include <QVersionNumber>
|
||||
|
||||
using namespace Git::Internal;
|
||||
@@ -156,7 +156,7 @@ GerritPushDialog::GerritPushDialog(const QString &workingDir, const QString &rev
|
||||
updateCommits(m_ui->localBranchComboBox->currentIndex());
|
||||
onRemoteChanged(true);
|
||||
|
||||
QRegExpValidator *noSpaceValidator = new QRegExpValidator(QRegExp("^\\S+$"), this);
|
||||
QRegularExpressionValidator *noSpaceValidator = new QRegularExpressionValidator(QRegularExpression("^\\S+$"), this);
|
||||
m_ui->reviewersLineEdit->setText(reviewerList);
|
||||
m_ui->reviewersLineEdit->setValidator(noSpaceValidator);
|
||||
m_ui->topicLineEdit->setValidator(noSpaceValidator);
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <utils/theme/theme.h>
|
||||
#include <utils/utilsicons.h>
|
||||
|
||||
#include <QRegExpValidator>
|
||||
#include <QRegularExpressionValidator>
|
||||
#include <QTextEdit>
|
||||
|
||||
#include <QDir>
|
||||
@@ -52,7 +52,7 @@ GitSubmitEditorWidget::GitSubmitEditorWidget() :
|
||||
m_gitSubmitPanelUi.setupUi(m_gitSubmitPanel);
|
||||
new GitSubmitHighlighter(descriptionEdit());
|
||||
|
||||
m_emailValidator = new QRegExpValidator(QRegExp("[^@ ]+@[^@ ]+\\.[a-zA-Z]+"), this);
|
||||
m_emailValidator = new QRegularExpressionValidator(QRegularExpression("[^@ ]+@[^@ ]+\\.[a-zA-Z]+"), this);
|
||||
const QPixmap error = Utils::Icons::CRITICAL.pixmap();
|
||||
m_gitSubmitPanelUi.invalidAuthorLabel->setPixmap(error);
|
||||
m_gitSubmitPanelUi.invalidEmailLabel->setToolTip(tr("Provide a valid email to commit."));
|
||||
|
||||
Reference in New Issue
Block a user