Skip to content

Commit 9d9e92e

Browse files
committed
Convert some QRegExp usages to QRegularExpression
1 parent 7ca90e0 commit 9d9e92e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/CipherDialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
#include "sqlitedb.h"
44

55
#include <QPushButton>
6-
#include <QRegExpValidator>
6+
#include <QRegularExpressionValidator>
77

88
#include <QtCore/qmath.h>
99

1010
CipherDialog::CipherDialog(QWidget* parent, bool encrypt) :
1111
QDialog(parent),
1212
ui(new Ui::CipherDialog),
1313
encryptMode(encrypt),
14-
rawKeyValidator(new QRegExpValidator(QRegExp("0x[a-fA-F0-9]+")))
14+
rawKeyValidator(new QRegularExpressionValidator(QRegularExpression("\\A(0x[a-fA-F0-9]+)\\Z")))
1515
{
1616
ui->setupUi(this);
1717

src/CipherDialog.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#include "CipherSettings.h"
77

8-
class QRegExpValidator;
8+
class QRegularExpressionValidator;
99

1010
namespace Ui {
1111
class CipherDialog;
@@ -26,7 +26,7 @@ class CipherDialog : public QDialog
2626
private:
2727
Ui::CipherDialog* ui;
2828
bool encryptMode;
29-
QRegExpValidator* rawKeyValidator;
29+
QRegularExpressionValidator* rawKeyValidator;
3030

3131
private slots:
3232
void checkInputFields();

src/ColumnDisplayFormatDialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ void ColumnDisplayFormatDialog::accept()
105105
// Users could still devise a way to break this, but this is considered good enough for letting them know about simple incorrect
106106
// cases.
107107
if(!(ui->editDisplayFormat->text() == sqlb::escapeIdentifier(column_name) ||
108-
ui->editDisplayFormat->text().contains(QRegExp("[a-z]+[a-z_0-9]* *\\(.*" + QRegExp::escape(sqlb::escapeIdentifier(column_name)) + ".*\\)", Qt::CaseInsensitive))))
108+
ui->editDisplayFormat->text().contains(QRegularExpression("[a-z]+[a-z_0-9]* *\\(.*" + QRegularExpression::escape(sqlb::escapeIdentifier(column_name)) + ".*\\)", QRegularExpression::CaseInsensitiveOption))))
109109
errorMessage = tr("Custom display format must contain a function call applied to %1").arg(sqlb::escapeIdentifier(column_name));
110110
else {
111111
// Execute a query using the display format and check that it only returns one column.

0 commit comments

Comments
 (0)