QTfrontend/ui/widget/selectWeapon.cpp
changeset 14844 e239378a9400
parent 14841 b9437746bffb
--- a/QTfrontend/ui/widget/selectWeapon.cpp	Thu Apr 25 21:25:16 2019 +0200
+++ b/QTfrontend/ui/widget/selectWeapon.cpp	Thu Apr 25 23:01:05 2019 +0200
@@ -31,6 +31,9 @@
 #include <QSettings>
 #include <QMessageBox>
 #include <QTabWidget>
+#include <QRegExp>
+#include <QRegExpValidator>
+
 #include <math.h>
 
 QImage getAmmoImage(int num)
@@ -205,6 +208,9 @@
 
     //pLayout->setRowStretch(5, 100);
     m_name = new QLineEdit(this);
+    QRegExp rx(*cSafeFileNameRegExp);
+    QRegExpValidator* val = new QRegExpValidator(rx, m_name);
+    m_name->setValidator(val);
     pageLayout->addWidget(m_name, i, 0, 1, 5);
 }