12std::string
OR(
const std::string &lhs,
const std::string &
rhs) {
return "(" + lhs +
"|" +
rhs +
")"; }
13std::string NATURAL_NUMBER_WITH_PRECISION(std::size_t digits) {
17const std::string EMPTY =
"^$";
18const std::string
SPACE =
"(\\s)*";
20const std::string DASH =
"\\-";
23const std::string NATURAL_NUMBER =
"(0|[1-9][0-9]*)";
24const std::string REAL_NUMBER =
"(-?" + NATURAL_NUMBER +
"(\\.[0-9]*)?)";
25const std::string REAL_RANGE =
"(" + REAL_NUMBER +
COMMA + REAL_NUMBER +
")";
26const std::string NUMBER = NATURAL_NUMBER_WITH_PRECISION(4);
27const std::string NATURAL_RANGE =
"(" + NUMBER + DASH + NUMBER +
")";
28const std::string NATURAL_OR_RANGE =
OR(NATURAL_RANGE, NUMBER);
31const std::string MASK_LIST =
"(" + REAL_RANGE +
"(" +
COMMA + REAL_RANGE +
")*" +
")|" + EMPTY;
32const std::string SPECTRA_LIST =
"(" + NATURAL_OR_RANGE +
"(" +
COMMA + NATURAL_OR_RANGE +
")*)";
36namespace MantidWidgets {
39 switch (validatorMask) {
45 throw std::logic_error(
"Invalid or Missing Validator String");
52 : QStyledItemDelegate(parent),
m_validator(QRegExp(QString::fromStdString(validator))) {}
55 const QModelIndex & )
const {
56 auto lineEdit =
new QLineEdit(parent);
57 auto validator =
new QRegExpValidator(
m_validator, parent);
58 lineEdit->setValidator(validator);
63 : QStyledItemDelegate(parent), m_precision(precision) {}
67 auto lineEdit =
new QLineEdit(parent);
68 auto validator =
new QDoubleValidator(parent);
71 validator->setNotation(QDoubleValidator::StandardNotation);
72 lineEdit->setValidator(validator);
Kernel::IValidator_sptr m_validator
const std::vector< double > & rhs
double value
The value of the point.
std::map< DeltaEMode::Type, std::string > index
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...
std::string to_string(const wide_integer< Bits, Signed > &n)