|
Krita Source Code Documentation
|
A wrapper around KisDoubleParseSpinBox, which is a cleverer doubleSpinBox, able to parse arithmetic expressions. The widget itself is accessed with the widget() function. More...
#include <DoubleParseSpinBox.h>
Inheritance diagram for DoubleParseSpinBox:Public Slots | |
| bool | isLastValid () const |
| Get if the last expression entered is a valid one. | |
| void | setValue (double value, bool overwriteExpression=false) |
| Set the value of the spinbox. | |
| void | stepBy (int steps) |
| This is a reimplementation of QDoubleSpinBox::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. | |
| QDoubleSpinBox * | widget () const |
| Get the internal KisDoubleParseSpinBox as a QWidget, so it may be added to a UI. | |
Signals | |
| 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. | |
Public Member Functions | |
| DoubleParseSpinBox () | |
| ~DoubleParseSpinBox () override | |
Private Attributes | |
| Private *const | d |
A wrapper around KisDoubleParseSpinBox, which is a cleverer doubleSpinBox, able to parse arithmetic expressions. The widget itself is accessed with the widget() function.
Use this spinbox instead of the basic one from Qt if you want it to be able to parse arithmetic expressions.
Definition at line 23 of file DoubleParseSpinBox.h.
|
explicit |
Definition at line 16 of file DoubleParseSpinBox.cpp.
References connect(), d, errorWhileParsing(), noMoreParsingError(), and krita::DoubleParseSpinBox::Private::widget.
|
override |
|
signal |
signal emitted when the last parsed expression is not valid.
|
slot |
Get if the last expression entered is a valid one.
| true | if the last expression entered is valid |
| false | otherwise |
Definition at line 47 of file DoubleParseSpinBox.cpp.
References d, KisDoubleParseSpinBox::isLastValid(), and krita::DoubleParseSpinBox::Private::widget.
|
signal |
signal emitted when the last parsed expression is valid and the expression before was not valid.
|
slot |
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.
| 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 42 of file DoubleParseSpinBox.cpp.
References d, KisDoubleParseSpinBox::setValue(), value(), and krita::DoubleParseSpinBox::Private::widget.
|
slot |
This is a reimplementation of QDoubleSpinBox::stepBy that uses setValue.
| steps | Number of steps that the value should change |
Definition at line 37 of file DoubleParseSpinBox.cpp.
References d, KisDoubleParseSpinBox::stepBy(), and krita::DoubleParseSpinBox::Private::widget.
|
virtualslot |
This virtual function is similar to cleanText(). But child classes may reimplement it to further process ("clean up") the expression.
Definition at line 52 of file DoubleParseSpinBox.cpp.
References d, KisDoubleParseSpinBox::veryCleanText(), and krita::DoubleParseSpinBox::Private::widget.
|
slot |
Get the internal KisDoubleParseSpinBox as a QWidget, so it may be added to a UI.
Definition at line 32 of file DoubleParseSpinBox.cpp.
References d, and krita::DoubleParseSpinBox::Private::widget.
|
private |
Definition at line 92 of file DoubleParseSpinBox.h.