|
Krita Source Code Documentation
|
A wrapper around KisIntParseSpinBox, which is a cleverer SpinBox, able to parse arithmetic expressions. The widget itself is accessed with the widget() function. More...
#include <IntParseSpinBox.h>
Inheritance diagram for IntParseSpinBox:Public Slots | |
| bool | isLastValid () const |
| Get if the last expression entered is a valid one. | |
| void | setValue (int value, bool overwriteExpression=false) |
| Set the value of the spinbox. | |
| void | stepBy (int steps) |
| 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. | |
| QSpinBox * | widget () const |
| Get the internal KisIntParseSpinBox 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 | |
| IntParseSpinBox () | |
| ~IntParseSpinBox () override | |
Private Attributes | |
| Private *const | d |
A wrapper around KisIntParseSpinBox, which is a cleverer SpinBox, 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 IntParseSpinBox.h.
|
explicit |
Definition at line 16 of file IntParseSpinBox.cpp.
References connect(), d, errorWhileParsing(), noMoreParsingError(), and krita::IntParseSpinBox::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 IntParseSpinBox.cpp.
References d, KisIntParseSpinBox::isLastValid(), and krita::IntParseSpinBox::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 IntParseSpinBox.cpp.
References d, KisIntParseSpinBox::setValue(), value(), and krita::IntParseSpinBox::Private::widget.
|
slot |
This is a reimplementation of QSpinBox::stepBy that uses setValue.
| steps | Number of steps that the value should change |
Definition at line 37 of file IntParseSpinBox.cpp.
References d, KisIntParseSpinBox::stepBy(), and krita::IntParseSpinBox::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 IntParseSpinBox.cpp.
References d, KisIntParseSpinBox::veryCleanText(), and krita::IntParseSpinBox::Private::widget.
|
slot |
Get the internal KisIntParseSpinBox as a QWidget, so it may be added to a UI.
Definition at line 32 of file IntParseSpinBox.cpp.
References d, and krita::IntParseSpinBox::Private::widget.
|
private |
Definition at line 90 of file IntParseSpinBox.h.