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:
@@ -28,7 +28,7 @@
|
||||
#include <QComboBox>
|
||||
#include <QLineEdit>
|
||||
#include <QRegExp>
|
||||
#include <QRegExpValidator>
|
||||
#include <QRegularExpressionValidator>
|
||||
|
||||
using namespace ScxmlEditor::PluginInterface;
|
||||
|
||||
@@ -51,9 +51,10 @@ QWidget *SCAttributeItemDelegate::createEditor(QWidget *parent, const QStyleOpti
|
||||
if (index.column() == 0) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user