The KisIntParseSpinBox class is a cleverer SpinBox, able to parse arithmetic expressions.
More...
#include <kis_int_parse_spin_box.h>
|
| void | errorWhileParsing (const QString &expr) const |
| | signal emitted when the last parsed expression is not valid.
|
| |
| void | noMoreParsingError () const |
| | signal emitted when the last parsed expression is valid and the expression before was not valid.
|
| |
|
| bool | isLastValid () const |
| | Get if the last expression entered is a valid one.
|
| |
| | KisIntParseSpinBox (QWidget *parent=0) |
| |
| void | setValue (int value, bool overwriteExpression=false) |
| | Set the value of the spinbox.
|
| |
| void | stepBy (int steps) override |
| | This is a reimplementation of QSpinBox::stepBy that uses setValue.
|
| |
| virtual QString | veryCleanText () const |
| | This virtual function is similar to cleanText(). But child classes may reimplement it to further process ("clean up") the expression.
|
| |
| | ~KisIntParseSpinBox () override |
| |
The KisIntParseSpinBox class is a cleverer SpinBox, able to parse arithmetic expressions.
Use this spinbox instead of the basic one from Qt if you want it to be able to parse arithmetic expressions.
Definition at line 25 of file kis_int_parse_spin_box.h.
◆ KisIntParseSpinBox()
| KisIntParseSpinBox::KisIntParseSpinBox |
( |
QWidget * | parent = 0 | ) |
|
Definition at line 13 of file kis_int_parse_spin_box.cpp.
13 :
14 QSpinBox(parent),
16{}
QScopedPointer< KisParseSpinBoxPrivate< KisIntParseSpinBox, QSpinBox > > d
◆ ~KisIntParseSpinBox()
| KisIntParseSpinBox::~KisIntParseSpinBox |
( |
| ) |
|
|
override |
◆ errorWhileParsing
| void KisIntParseSpinBox::errorWhileParsing |
( |
const QString & | expr | ) |
const |
|
signal |
signal emitted when the last parsed expression is not valid.
◆ isLastValid()
| bool KisIntParseSpinBox::isLastValid |
( |
| ) |
const |
Get if the last expression entered is a valid one.
- Return values
-
| true | if the last expression entered is valid |
| false | otherwise |
Definition at line 31 of file kis_int_parse_spin_box.cpp.
32{
33 return d->isLastValid();
34}
References d.
◆ noMoreParsingError
| void KisIntParseSpinBox::noMoreParsingError |
( |
| ) |
const |
|
signal |
signal emitted when the last parsed expression is valid and the expression before was not valid.
◆ setValue()
| void KisIntParseSpinBox::setValue |
( |
int | value, |
|
|
bool | overwriteExpression = false ) |
Set the value of the spinbox.
This reimplementation also tries to clear the current expression and warning message whenever possible. This will happen when the new value is different from the current one and the line edit has not the focus or it is read-only. One can force the reset also by passing true to the overwriteExpression parameter.
- Parameters
-
| value | The new value |
| overwriteExpression | Get if the expression in the edit field (and the warning message) should be reset to reflect the new value. The default is false so that if the user is editing the expression it won't be disrupted by any default call to this function |
Definition at line 26 of file kis_int_parse_spin_box.cpp.
27{
28 d->setValue(
value, overwriteExpression);
29}
float value(const T *src, size_t ch)
References d, and value().
◆ stepBy()
| void KisIntParseSpinBox::stepBy |
( |
int | steps | ) |
|
|
override |
This is a reimplementation of QSpinBox::stepBy that uses setValue.
- Parameters
-
| steps | Number of steps that the value should change |
Definition at line 21 of file kis_int_parse_spin_box.cpp.
References d.
◆ textFromValue()
| QString KisIntParseSpinBox::textFromValue |
( |
int | value | ) |
const |
|
overrideprotected |
◆ validate()
| QValidator::State KisIntParseSpinBox::validate |
( |
QString & | input, |
|
|
int & | pos ) const |
|
overrideprotected |
◆ valueFromText()
| int KisIntParseSpinBox::valueFromText |
( |
const QString & | text | ) |
const |
|
overrideprotected |
◆ veryCleanText()
| QString KisIntParseSpinBox::veryCleanText |
( |
| ) |
const |
|
virtual |
This virtual function is similar to cleanText(). But child classes may reimplement it to further process ("clean up") the expression.
- Returns
- The processed expression
Definition at line 36 of file kis_int_parse_spin_box.cpp.
37{
38 return d->veryCleanText();
39}
References d.
◆ KisParseSpinBoxPrivate
template<typename SpinBoxTypeTP , typename BaseSpinBoxTypeTP >
The documentation for this class was generated from the following files: