|
Krita Source Code Documentation
|
This class is a wrapper around KisSliderSpinBox, a spinbox in which you can click and drag to set the value, with a slider like bar displayed inside. The widget itself is accessed with the widget() function. More...
#include <SliderSpinBox.h>
Inheritance diagram for SliderSpinBox:Public Slots | |
| int | fastSliderStep () const |
| Get the value to which multiples the spinbox value snaps when the control key is pressed. | |
| bool | isDragging () const |
| Get if the user is currently dragging the slider with the pointer. | |
| void | setBlockUpdateSignalOnDrag (bool newBlockUpdateSignalOnDrag) |
| Set if the spinbox should not Q_EMIT signals when dragging the slider. | |
| void | setExponentRatio (qreal newExponentRatio) |
| Set the exponent used by a power function to modify the values as a function of the horizontal position. | |
| void | setFastSliderStep (int newFastSliderStep) |
| Set the value to which multiples the spinbox value snaps when the control key is pressed. | |
| void | setMaximum (int newMaximum, bool computeNewFastSliderStep=true) |
| Set the maximum value of the range. | |
| void | setMinimum (int newMinimum, bool computeNewFastSliderStep=true) |
| Set the minimum value of the range. | |
| void | setRange (int newMinimum, int newMaximum, bool computeNewFastSliderStep=true) |
| Set the minimum and the maximum values of the range, computing a new "fast slider step" based on the range if required. | |
| void | setSoftMaximum (int newSoftMaximum) |
| Set the maximum value of the soft range. | |
| void | setSoftMinimum (int newSoftMinimum) |
| Set the minimum value of the soft range. | |
| void | setSoftRange (int newSoftMinimum, int newSoftMaximum) |
| Set the minimum and the maximum values of the soft range. | |
| void | setValue (int newValue) |
| Set the value. | |
| int | softMaximum () const |
| Get the maximum value of the "soft range". | |
| int | softMinimum () const |
| Get the minimum value of the "soft range". | |
| QWidget * | widget () const |
| Get the internal KisSliderSpinBox as a QWidget, so it may be added to a UI. | |
Public Slots inherited from IntParseSpinBox | |
| 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 | draggingFinished () |
Signals inherited from IntParseSpinBox | |
| 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 | |
| SliderSpinBox () | |
| ~SliderSpinBox () override | |
Public Member Functions inherited from IntParseSpinBox | |
| IntParseSpinBox () | |
| ~IntParseSpinBox () override | |
Private Attributes | |
| Private *const | d |
This class is a wrapper around KisSliderSpinBox, a spinbox in which you can click and drag to set the value, with a slider like bar displayed inside. The widget itself is accessed with the widget() function.
The value can be set by click and dragging with the mouse or pen or by typing in with the keyboard. To enter the edit mode, in which the keyboard can be used, one has to right-click inside the spinbox or click and hold the pointer inside or press the enter key. To leave the edit mode, one can press the enter key again, in which case the value is committed, or press the escape key, in which case the value is rejected.
When dragging with the pointer, one can fine tune the value by dragging far away vertically from the spinbox. The farther the pointer is, the slower the value will change. If the pointer is inside the spinbox plus a certain margin, the value will not be scaled. By pressing the shift key the slow down will be even more pronounced and by pressing the control key the value will snap to the increment set by setFastSliderStep. The two keys can be used at the same time.
A "soft range" can be set to make the slider display only a sub-range of the spinbox range. This way one can have a large range but display and set with the pointer and with more precision only the most commonly used sub-set of values. A value outside the "soft range" can be set by entering the edit mode and using the keyboard. The "soft range" is considered valid if the "soft maximum" is greater than the "soft minimum".
Definition at line 50 of file SliderSpinBox.h.
|
explicit |
Definition at line 17 of file SliderSpinBox.cpp.
References connect(), d, draggingFinished(), and krita::SliderSpinBox::Private::widget.
|
override |
|
signal |
|
slot |
Get the value to which multiples the spinbox value snaps when the control key is pressed.
Definition at line 36 of file SliderSpinBox.cpp.
References d, KisSliderSpinBox::fastSliderStep(), and krita::SliderSpinBox::Private::widget.
|
slot |
Get if the user is currently dragging the slider with the pointer.
Definition at line 51 of file SliderSpinBox.cpp.
References d, KisSliderSpinBox::isDragging(), and krita::SliderSpinBox::Private::widget.
|
slot |
Set if the spinbox should not Q_EMIT signals when dragging the slider.
This is useful to prevent multiple updates when changing the value if the update operation is costly. A valueChanged signal will be emitted when the pointer is released from the slider.
| newBlockUpdateSignalOnDrag | true if the spinbox should not emit signals when dragging the slider. false otherwise |
Definition at line 85 of file SliderSpinBox.cpp.
References d, KisSliderSpinBox::setBlockUpdateSignalOnDrag(), and krita::SliderSpinBox::Private::widget.
|
slot |
Set the exponent used by a power function to modify the values as a function of the horizontal position.
This allows having more values concentrated in one side of the slider than the other
| newExponentRatio | the new exponent to be used by the power function |
Definition at line 76 of file SliderSpinBox.cpp.
References d, dbgScript, KisSliderSpinBox::setExponentRatio(), and krita::SliderSpinBox::Private::widget.
|
slot |
Set the value to which multiples the spinbox value snaps when the control key is pressed.
| newFastSliderStep | value to which multiples the spinbox value snaps when the control key is pressed |
Definition at line 90 of file SliderSpinBox.cpp.
References d, KisSliderSpinBox::setFastSliderStep(), and krita::SliderSpinBox::Private::widget.
|
slot |
Set the maximum value of the range.
The soft range will be adapted to fit inside the range
| newMaximum | the new maximum value |
| computeNewFastSliderStep | true if a new "fast slider step" must be computed based on the range |
Definition at line 71 of file SliderSpinBox.cpp.
References d, KisSliderSpinBox::setMaximum(), and krita::SliderSpinBox::Private::widget.
|
slot |
Set the minimum value of the range.
The soft range will be adapted to fit inside the range
| newMinimum | the new minimum value |
| computeNewFastSliderStep | true if a new "fast slider step" must be computed based on the range |
Definition at line 66 of file SliderSpinBox.cpp.
References d, KisSliderSpinBox::setMinimum(), and krita::SliderSpinBox::Private::widget.
|
slot |
Set the minimum and the maximum values of the range, computing a new "fast slider step" based on the range if required.
The soft range will be adapted to fit inside the range
| newMinimum | the new minimum value |
| newMaximum | the new maximum value |
| computeNewFastSliderStep | true if a new "fast slider step" must be computed based on the range |
Definition at line 61 of file SliderSpinBox.cpp.
References d, KisSliderSpinBox::setRange(), and krita::SliderSpinBox::Private::widget.
|
slot |
Set the maximum value of the soft range.
| newSoftMaximum | the new maximum value |
Definition at line 105 of file SliderSpinBox.cpp.
References d, KisSliderSpinBox::setSoftMaximum(), and krita::SliderSpinBox::Private::widget.
|
slot |
Set the minimum value of the soft range.
| newSoftMinimum | the new minimum value |
Definition at line 100 of file SliderSpinBox.cpp.
References d, KisSliderSpinBox::setSoftMinimum(), and krita::SliderSpinBox::Private::widget.
|
slot |
Set the minimum and the maximum values of the soft range.
| newSoftMinimum | the new minimum value |
| newSoftMaximum | the new maximum value |
Definition at line 95 of file SliderSpinBox.cpp.
References d, KisSliderSpinBox::setSoftRange(), and krita::SliderSpinBox::Private::widget.
|
slot |
Set the value.
| newValue | the new value |
Definition at line 56 of file SliderSpinBox.cpp.
References d, KisSliderSpinBox::setValue(), and krita::SliderSpinBox::Private::widget.
|
slot |
Get the maximum value of the "soft range".
Definition at line 46 of file SliderSpinBox.cpp.
References d, KisSliderSpinBox::softMaximum(), and krita::SliderSpinBox::Private::widget.
|
slot |
Get the minimum value of the "soft range".
Definition at line 41 of file SliderSpinBox.cpp.
References d, KisSliderSpinBox::softMinimum(), and krita::SliderSpinBox::Private::widget.
|
slot |
Get the internal KisSliderSpinBox as a QWidget, so it may be added to a UI.
Definition at line 32 of file SliderSpinBox.cpp.
References d, and krita::SliderSpinBox::Private::widget.
|
private |
Definition at line 204 of file SliderSpinBox.h.