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".
Methods
Signals
Member documentation
Get the value to which multiples the spinbox value snaps when the control key is pressed
Return
the value to which multiples the spinbox value snaps when the control key is pressed |
Get if the user is currently dragging the slider with the pointer
Return
true if the user is currently dragging the slider with the pointer, false otherwise |
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.
Parameters
newBlockUpdateSignalOnDrag | true if the spinbox should not emit signals when dragging the slider. false otherwise |
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
Parameters
newExponentRatio | the new exponent to be used by the power function |
Set the value to which multiples the spinbox value snaps when the control key is pressed
Parameters
newFastSliderStep | value to which multiples the spinbox value snaps when the control key is pressed |
Set the maximum value of the range
The soft range will be adapted to fit inside the range
Parameters
newMaximum | the new maximum value |
computeNewFastSliderStep | true if a new "fast slider step" must be computed based on the range |
Set the minimum value of the range
The soft range will be adapted to fit inside the range
Parameters
newMinimum | the new minimum value |
computeNewFastSliderStep | true if a new "fast slider step" must be computed based on the range |
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
Parameters
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 |
Set the maximum value of the soft range
Parameters
newSoftMaximum | the new maximum value |
Set the minimum value of the soft range
Parameters
newSoftMinimum | the new minimum value |
Set the minimum and the maximum values of the soft range
Parameters
newSoftMinimum | the new minimum value |
newSoftMaximum | the new maximum value |
Get the maximum value of the "soft range"
Return
the maximum value of the "soft range" |
Get the minimum value of the "soft range"
Return
the minimum value of the "soft range" |
Get the internal KisSliderSpinBox as a QWidget, so it may be added to a UI
Return
the internal KisSliderSpinBox as a QWidget |