mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3910 Unit test for reg exp validator
This commit is contained in:
@@ -237,6 +237,15 @@ void RimWellPathCompletions::setUnitSystemSpecificDefaults()
|
||||
m_perforationCollection->setUnitSystemSpecificDefaults();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QRegExp RimWellPathCompletions::wellNameForExportRegExp()
|
||||
{
|
||||
QRegExp rx("[\\w\\-\\_]{1,8}");
|
||||
return rx;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -295,9 +304,8 @@ void RimWellPathCompletions::defineEditorAttribute(const caf::PdmFieldHandle* fi
|
||||
caf::PdmUiLineEditorAttribute* lineEditorAttr = dynamic_cast<caf::PdmUiLineEditorAttribute*>(attribute);
|
||||
if (field == &m_wellNameForExport && lineEditorAttr)
|
||||
{
|
||||
QRegExp rx("[\\w\\-\\_]{1,8}");
|
||||
QRegExpValidator* validator = new QRegExpValidator(nullptr);
|
||||
validator->setRegExp(rx);
|
||||
validator->setRegExp(wellNameForExportRegExp());
|
||||
lineEditorAttr->validator = validator;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user