diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-03-18 13:32:28 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-03-20 11:39:42 +0000 |
commit | 99a81e78d5b2a55226161d7aa7483ab2cb918f8b (patch) | |
tree | e819eddf8833b69b4ad089dee7cca46eb5f6bf20 /src/plugins/scxmleditor/common/structure.cpp | |
parent | 2e4915bdb96bc1d5e5bed6f38e13b87db68a97c5 (diff) | |
download | qt-creator-99a81e78d5b2a55226161d7aa7483ab2cb918f8b.tar.gz |
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>
Diffstat (limited to 'src/plugins/scxmleditor/common/structure.cpp')
-rw-r--r-- | src/plugins/scxmleditor/common/structure.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/scxmleditor/common/structure.cpp b/src/plugins/scxmleditor/common/structure.cpp index 08164e0aa3..96f8e29fd4 100644 --- a/src/plugins/scxmleditor/common/structure.cpp +++ b/src/plugins/scxmleditor/common/structure.cpp @@ -42,7 +42,7 @@ #include <QLabel> #include <QLineEdit> #include <QRegExp> -#include <QRegExpValidator> +#include <QRegularExpressionValidator> #include <QToolBar> #include <QToolButton> #include <QUndoStack> @@ -63,9 +63,9 @@ QWidget *TreeItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewI if (index.isValid()) { auto edit = new QLineEdit(parent); edit->setFocusPolicy(Qt::StrongFocus); - QRegExp rx("^(?!xml)[_a-z][a-z0-9-._]*$"); - rx.setCaseSensitivity(Qt::CaseInsensitive); - edit->setValidator(new QRegExpValidator(rx, parent)); + QRegularExpression rx("^(?!xml)[_a-z][a-z0-9-._]*$"); + rx.setPatternOptions(QRegularExpression::CaseInsensitiveOption); + edit->setValidator(new QRegularExpressionValidator(rx, parent)); return edit; } return QStyledItemDelegate::createEditor(parent, option, index); |