Skip to content

Commit a4b8dfa

Browse files
author
rblazek
committed
output name validator
git-svn-id: http://svn.osgeo.org/qgis/trunk@5076 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 1847bba commit a4b8dfa

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/plugins/grass/qgsgrassmodule.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
#include <QGridLayout>
6666
#include <QIntValidator>
6767
#include <QDoubleValidator>
68+
#include <QRegExpValidator>
6869
#include <QPushButton>
6970
#include <QGroupBox>
7071
#include <QFileDialog>
@@ -1151,6 +1152,19 @@ void QgsGrassModuleOption::addLineEdit()
11511152
} else {
11521153
mValidator = new QDoubleValidator( this );
11531154
}
1155+
lineEdit->setValidator ( mValidator );
1156+
} else if ( mIsOutput ) {
1157+
QRegExp rx;
1158+
if ( mOutputType == Vector )
1159+
{
1160+
rx.setPattern("[A-Za-z_][A-Za-z0-9_]+");
1161+
}
1162+
else
1163+
{
1164+
rx.setPattern("[A-Za-z0-9_.]+");
1165+
}
1166+
mValidator = new QRegExpValidator( rx, this );
1167+
11541168
lineEdit->setValidator ( mValidator );
11551169
}
11561170

@@ -2247,3 +2261,4 @@ QString QgsGrassModuleFile::ready()
22472261
QgsGrassModuleFile::~QgsGrassModuleFile()
22482262
{
22492263
}
2264+

0 commit comments

Comments
 (0)