Krita Source Code Documentation
Loading...
Searching...
No Matches
DoubleSliderSpinBox Class Reference

This class is a wrapper around KisDoubleSliderSpinBox, 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 DoubleSliderSpinBox:

Public Slots

qreal fastSliderStep () const
 
bool isDragging () const
 
void setBlockUpdateSignalOnDrag (bool newBlockUpdateSignalOnDrag)
 
void setExponentRatio (qreal newExponentRatio)
 
void setFastSliderStep (qreal newFastSliderStep)
 
void setMaximum (qreal newMaximum, bool computeNewFastSliderStep=true)
 
void setMinimum (qreal newMinimum, bool computeNewFastSliderStep=true)
 
void setRange (qreal newMinimum, qreal newMaximum, int newNumberOfDecimals=0, bool computeNewFastSliderStep=true)
 Set the minimum and the maximum values of the range.
 
void setSoftMaximum (qreal newSoftMaximum)
 
void setSoftMinimum (qreal newSoftMinimum)
 
void setSoftRange (qreal newSoftMinimum, qreal newSoftMaximum)
 
void setValue (qreal newValue)
 
qreal softMaximum () const
 
qreal softMinimum () const
 
QWidget * widget () const
 Get the internal KisDoubleSliderSpinBox as a QWidget, so it may be added to a UI.
 
- Public Slots inherited from DoubleParseSpinBox
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 draggingFinished ()
 
- Signals inherited from DoubleParseSpinBox
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

 DoubleSliderSpinBox ()
 
 ~DoubleSliderSpinBox () override
 
- Public Member Functions inherited from DoubleParseSpinBox
 DoubleParseSpinBox ()
 
 ~DoubleParseSpinBox () override
 

Private Attributes

Private *const d
 

Detailed Description

This class is a wrapper around KisDoubleSliderSpinBox, 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.

See also
SliderSpinBox

Definition at line 214 of file SliderSpinBox.h.

Constructor & Destructor Documentation

◆ DoubleSliderSpinBox()

DoubleSliderSpinBox::DoubleSliderSpinBox ( )
explicit

Definition at line 116 of file SliderSpinBox.cpp.

118 , d(new Private)
119{
121
122 // Forward KisDoubleSliderSpinBox::draggingFinished to DoubleSliderSpinBox::draggingFinished
123 connect(d->widget, SIGNAL(draggingFinished()), this, SIGNAL(draggingFinished()));
124}
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
This class is a spinbox in which you can click and drag to set the value. A slider like bar is displa...

References connect(), d, draggingFinished(), and krita::DoubleSliderSpinBox::Private::widget.

◆ ~DoubleSliderSpinBox()

DoubleSliderSpinBox::~DoubleSliderSpinBox ( )
override

Definition at line 126 of file SliderSpinBox.cpp.

127{
128 delete d;
129}

References d.

Member Function Documentation

◆ draggingFinished

void DoubleSliderSpinBox::draggingFinished ( )
signal

◆ fastSliderStep

double DoubleSliderSpinBox::fastSliderStep ( ) const
slot

◆ isDragging

bool DoubleSliderSpinBox::isDragging ( ) const
slot

◆ setBlockUpdateSignalOnDrag

void DoubleSliderSpinBox::setBlockUpdateSignalOnDrag ( bool newBlockUpdateSignalOnDrag)
slot

Definition at line 185 of file SliderSpinBox.cpp.

186{
187 d->widget->setBlockUpdateSignalOnDrag(newBlockUpdateSignalOnDrag);
188}
void setBlockUpdateSignalOnDrag(bool newBlockUpdateSignalOnDrag)

References d, KisDoubleSliderSpinBox::setBlockUpdateSignalOnDrag(), and krita::DoubleSliderSpinBox::Private::widget.

◆ setExponentRatio

void DoubleSliderSpinBox::setExponentRatio ( qreal newExponentRatio)
slot

Definition at line 176 of file SliderSpinBox.cpp.

177{
178 if (newExponentRatio <= 0.0) {
179 dbgScript << "Script using DoubleSliderSpinbox.setExponentRatio passed value <= 0.0 (" << newExponentRatio << "), ignoring.";
180 return;
181 }
182 d->widget->setExponentRatio(newExponentRatio);
183}
void setExponentRatio(qreal newExponentRatio)
#define dbgScript
Definition kis_debug.h:56

References d, dbgScript, KisDoubleSliderSpinBox::setExponentRatio(), and krita::DoubleSliderSpinBox::Private::widget.

◆ setFastSliderStep

void DoubleSliderSpinBox::setFastSliderStep ( qreal newFastSliderStep)
slot

Definition at line 190 of file SliderSpinBox.cpp.

191{
192 d->widget->setFastSliderStep(newFastSliderStep);
193}
void setFastSliderStep(qreal newFastSliderStep)

References d, KisDoubleSliderSpinBox::setFastSliderStep(), and krita::DoubleSliderSpinBox::Private::widget.

◆ setMaximum

void DoubleSliderSpinBox::setMaximum ( qreal newMaximum,
bool computeNewFastSliderStep = true )
slot

Definition at line 171 of file SliderSpinBox.cpp.

172{
173 d->widget->setMaximum(newMaximum, computeNewFastSliderStep);
174}
void setMaximum(qreal newMaximum, bool computeNewFastSliderStep=true)

References d, KisDoubleSliderSpinBox::setMaximum(), and krita::DoubleSliderSpinBox::Private::widget.

◆ setMinimum

void DoubleSliderSpinBox::setMinimum ( qreal newMinimum,
bool computeNewFastSliderStep = true )
slot

Definition at line 166 of file SliderSpinBox.cpp.

167{
168 d->widget->setMinimum(newMinimum, computeNewFastSliderStep);
169}
void setMinimum(qreal newMinimum, bool computeNewFastSliderStep=true)

References d, KisDoubleSliderSpinBox::setMinimum(), and krita::DoubleSliderSpinBox::Private::widget.

◆ setRange

void DoubleSliderSpinBox::setRange ( qreal newMinimum,
qreal newMaximum,
int newNumberOfDecimals = 0,
bool computeNewFastSliderStep = true )
slot

Set the minimum and the maximum values of the range.

The soft range will be adapted to fit inside the range The number of decimals used can be changed with the newNumberOfDecimals parameter

Parameters
newMinimumthe new minimum value
newMaximumthe new maximum value
newNumberOfDecimalsthe new number of decimals
computeNewFastSliderSteptrue if a new "fast slider step" must be computed based on the range
See also
setMinimum(qreal)
setMaximum(qreal)

Definition at line 161 of file SliderSpinBox.cpp.

162{
163 d->widget->setRange(newMinimum, newMaximum, newNumberOfDecimals, computeNewFastSliderStep);
164}
void setRange(qreal newMinimum, qreal newMaximum, int newNumberOfDecimals=0, bool computeNewFastSliderStep=true)
Set the minimum and the maximum values of the range.

References d, KisDoubleSliderSpinBox::setRange(), and krita::DoubleSliderSpinBox::Private::widget.

◆ setSoftMaximum

void DoubleSliderSpinBox::setSoftMaximum ( qreal newSoftMaximum)
slot

Definition at line 205 of file SliderSpinBox.cpp.

206{
207 setSoftRange(d->widget->softMinimum(), newSoftMaximum);
208}
void setSoftRange(qreal newSoftMinimum, qreal newSoftMaximum)

References d, setSoftRange(), KisDoubleSliderSpinBox::softMinimum(), and krita::DoubleSliderSpinBox::Private::widget.

◆ setSoftMinimum

void DoubleSliderSpinBox::setSoftMinimum ( qreal newSoftMinimum)
slot

◆ setSoftRange

void DoubleSliderSpinBox::setSoftRange ( qreal newSoftMinimum,
qreal newSoftMaximum )
slot

Definition at line 195 of file SliderSpinBox.cpp.

196{
197 d->widget->setSoftRange(newSoftMinimum, newSoftMaximum);
198}
void setSoftRange(qreal newSoftMinimum, qreal newSoftMaximum)

References d, KisDoubleSliderSpinBox::setSoftRange(), and krita::DoubleSliderSpinBox::Private::widget.

◆ setValue

void DoubleSliderSpinBox::setValue ( qreal newValue)
slot

Definition at line 156 of file SliderSpinBox.cpp.

157{
158 d->widget->setValue(newValue);
159}
void setValue(qreal newValue)

References d, KisDoubleSliderSpinBox::setValue(), and krita::DoubleSliderSpinBox::Private::widget.

◆ softMaximum

double DoubleSliderSpinBox::softMaximum ( ) const
slot

Definition at line 146 of file SliderSpinBox.cpp.

147{
148 return d->widget->softMaximum();
149}

References d, KisDoubleSliderSpinBox::softMaximum(), and krita::DoubleSliderSpinBox::Private::widget.

◆ softMinimum

double DoubleSliderSpinBox::softMinimum ( ) const
slot

Definition at line 141 of file SliderSpinBox.cpp.

142{
143 return d->widget->softMinimum();
144}

References d, KisDoubleSliderSpinBox::softMinimum(), and krita::DoubleSliderSpinBox::Private::widget.

◆ widget

QWidget * DoubleSliderSpinBox::widget ( ) const
slot

Get the internal KisDoubleSliderSpinBox as a QWidget, so it may be added to a UI.

Returns
the internal KisDoubleSliderSpinBox as a QWidget

Definition at line 131 of file SliderSpinBox.cpp.

132{
133 return d->widget;
134}

References d, and krita::DoubleSliderSpinBox::Private::widget.

Member Data Documentation

◆ d

Private* const DoubleSliderSpinBox::d
private

Definition at line 267 of file SliderSpinBox.h.


The documentation for this class was generated from the following files: