summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMahmoud Badri <mahmoud.badri@qt.io>2019-03-15 15:57:31 +0200
committerMahmoud Badri <mahmoud.badri@qt.io>2019-03-15 14:10:37 +0000
commitd7e63fe1295c524d7e3d8d81a98f60accc7ddd5a (patch)
tree0a4a31b913a446eb9e14156073261e260aa45149
parent4505bc5d87831afeb73ea392d5de7fb8e7471186 (diff)
Prevent special characters in variants group/tag namev2.3.0-beta3
Only underscore is alloweed. Specifically , and : are problematic. Change-Id: Iaddcd7f1476c6377236ecce51512b055616a3f7d Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r--src/Authoring/Studio/Palettes/Inspector/VariantTagDialog.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Authoring/Studio/Palettes/Inspector/VariantTagDialog.cpp b/src/Authoring/Studio/Palettes/Inspector/VariantTagDialog.cpp
index 83e72e7b..418df26b 100644
--- a/src/Authoring/Studio/Palettes/Inspector/VariantTagDialog.cpp
+++ b/src/Authoring/Studio/Palettes/Inspector/VariantTagDialog.cpp
@@ -33,6 +33,8 @@
#include "Core.h"
#include "ProjectFile.h"
+#include <QtGui/qvalidator.h>
+
VariantTagDialog::VariantTagDialog(DialogType type, const QString &group, const QString &name,
QWidget *parent)
: QDialog(parent)
@@ -44,6 +46,9 @@ VariantTagDialog::VariantTagDialog(DialogType type, const QString &group, const
m_names.first = name;
+ QRegExpValidator *rgx = new QRegExpValidator(QRegExp("[\\w\\s]+"), this);
+ m_ui->lineEditTagName->setValidator(rgx);
+
if (type == AddGroup) {
setWindowTitle(tr("Add new Group"));
m_ui->label->setText(tr("Group name"));