41 #ifndef OPTIKA_VALIDATORAPPLIER_HPP_
42 #define OPTIKA_VALIDATORAPPLIER_HPP_
44 #include <QDoubleSpinBox>
45 #include <QIntValidator>
46 #include <QDoubleValidator>
78 spinBox->setMinimum(validator->getMin());
79 spinBox->setMaximum(validator->getMax());
80 spinBox->setSingleStep(validator->getStep());
90 QIntValidator* qvalidator =
new QIntValidator(lineEdit);
92 qvalidator->setRange(validator->getMin(), validator->getMax());
97 lineEdit->setValidator(qvalidator);
123 spinBox->setMinimum(validator->getMin());
124 spinBox->setMaximum(validator->getMax());
125 spinBox->setSingleStep(validator->getStep());
126 spinBox->setDecimals(validator->getPrecision());
137 QDoubleValidator* qvalidator =
new QDoubleValidator(lineEdit);
139 qvalidator->setRange(validator->getMin(), validator->getMax());
140 qvalidator->setDecimals(validator->getPrecision());
146 lineEdit->setValidator(qvalidator);
171 spinBox->setMinimum(validator->getMin());
172 spinBox->setMaximum(validator->getMax());
173 spinBox->setSingleStep(validator->getStep());
174 spinBox->setDecimals(validator->getPrecision());
185 QDoubleValidator* qvalidator =
new QDoubleValidator(lineEdit);
187 qvalidator->setRange(validator->getMin(), validator->getMax());
188 qvalidator->setDecimals(validator->getPrecision());
194 lineEdit->setValidator(qvalidator);
201 #endif // OPTIKA_VALIDATORAPPLIER_HPP_
static void applyToSpinBox(RCP< const EnhancedNumberValidator< float > > validator, QDoubleSpinBox *spinBox)
Applies an EnhancedNumberValidator of type float to a QDoubleSpinBox.
bool is_null(const boost::shared_ptr< T > &p)
static void applyToSpinBox(RCP< const EnhancedNumberValidator< double > > validator, QDoubleSpinBox *spinBox)
Applies an EnhancedNumberValidator of type double to a QDoubleSpinBox.
static void applyToLineEdit(RCP< const EnhancedNumberValidator< double > > validator, QLineEdit *lineEdit)
A Header file that includes some of the commonly used includes throughtout Optika as well as some ove...
static void applyToLineEdit(RCP< const EnhancedNumberValidator< float > > validator, QLineEdit *lineEdit)
A templated class that applies the minimum, maximum and step specified in an EnhancedNumberValidator ...
static void applyToSpinBox(RCP< const EnhancedNumberValidator< S > > validator, QSpinBox *spinBox)
Applied attributes of the validator to the spin box.
static void applyToLineEdit(RCP< const EnhancedNumberValidator< S > > validator, QLineEdit *lineEdit)