Convert some QRegExp usages to QRegularExpression

This commit is contained in:
Martin Kleusberg
2019-09-28 15:15:07 +02:00
parent 7ca90e0f7e
commit 9d9e92e5ee
3 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -3,7 +3,7 @@
#include "sqlitedb.h"
#include <QPushButton>
#include <QRegExpValidator>
#include <QRegularExpressionValidator>
#include <QtCore/qmath.h>
@@ -11,7 +11,7 @@ CipherDialog::CipherDialog(QWidget* parent, bool encrypt) :
QDialog(parent),
ui(new Ui::CipherDialog),
encryptMode(encrypt),
rawKeyValidator(new QRegExpValidator(QRegExp("0x[a-fA-F0-9]+")))
rawKeyValidator(new QRegularExpressionValidator(QRegularExpression("\\A(0x[a-fA-F0-9]+)\\Z")))
{
ui->setupUi(this);
+2 -2
View File
@@ -5,7 +5,7 @@
#include "CipherSettings.h"
class QRegExpValidator;
class QRegularExpressionValidator;
namespace Ui {
class CipherDialog;
@@ -26,7 +26,7 @@ public:
private:
Ui::CipherDialog* ui;
bool encryptMode;
QRegExpValidator* rawKeyValidator;
QRegularExpressionValidator* rawKeyValidator;
private slots:
void checkInputFields();
+1 -1
View File
@@ -105,7 +105,7 @@ void ColumnDisplayFormatDialog::accept()
// Users could still devise a way to break this, but this is considered good enough for letting them know about simple incorrect
// cases.
if(!(ui->editDisplayFormat->text() == sqlb::escapeIdentifier(column_name) ||
ui->editDisplayFormat->text().contains(QRegExp("[a-z]+[a-z_0-9]* *\\(.*" + QRegExp::escape(sqlb::escapeIdentifier(column_name)) + ".*\\)", Qt::CaseInsensitive))))
ui->editDisplayFormat->text().contains(QRegularExpression("[a-z]+[a-z_0-9]* *\\(.*" + QRegularExpression::escape(sqlb::escapeIdentifier(column_name)) + ".*\\)", QRegularExpression::CaseInsensitiveOption))))
errorMessage = tr("Custom display format must contain a function call applied to %1").arg(sqlb::escapeIdentifier(column_name));
else {
// Execute a query using the display format and check that it only returns one column.