Skip to content

Commit

Permalink
Added validator to run-range. Refs #8317.
Browse files Browse the repository at this point in the history
- This allows only numbers and one hyphen or colon.
  • Loading branch information
jawrainey committed Nov 1, 2013
1 parent d9b068c commit d42538c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Code/Mantid/MantidQt/MantidWidgets/src/ICatSearch2.cpp
Expand Up @@ -111,6 +111,10 @@ namespace MantidQt
m_icatUiForm.resPageTxt->hide();
m_icatUiForm.resPreviousTxt->hide();

// Limit input to: A number, 1 hyphen or colon followed by another number. E.g. 444-444, -444, 444-
QRegExp re("[0-9]*(-|:){1}[0-9]*");
m_icatUiForm.RunRange->setValidator(new QRegExpValidator(re, this));

// Resize to minimum width/height to improve UX.
this->resize(minimumSizeHint());
}
Expand Down

0 comments on commit d42538c

Please sign in to comment.