Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_slider_spin_box.cpp
Go to the documentation of this file.
1/* This file is part of the KDE project
2 *
3 * SPDX-FileCopyrightText: 2010 Justin Noel <justin@ics.com>
4 * SPDX-FileCopyrightText: 2010 Cyrille Berger <cberger@cberger.net>
5 * SPDX-FileCopyrightText: 2015 Moritz Molch <kde@moritzmolch.de>
6 * SPDX-FileCopyrightText: 2021 Deif Lou <ginoba@gmail.com>
7 *
8 * SPDX-License-Identifier: LGPL-2.0-or-later
9 */
10
12#include "kis_slider_spin_box.h"
13
18
21
23{
24 return d->fastSliderStep();
25}
26
28{
29 return d->softMinimum();
30}
31
33{
34 return d->softMaximum();
35}
36
38{
39 return d->isDragging();
40}
41
43{
44 return d->sizeHint();
45}
46
48{
49 return d->minimumSizeHint();
50}
51
53{
54 d->setValue(newValue);
55}
56
57void KisSliderSpinBox::setRange(int newMinimum, int newMaximum, bool computeNewFastSliderStep)
58{
59 d->setRange(newMinimum, newMaximum, computeNewFastSliderStep);
60}
61
62void KisSliderSpinBox::setMinimum(int newMinimum, bool computeNewFastSliderStep)
63{
64 setRange(newMinimum, maximum(), computeNewFastSliderStep);
65}
66
67void KisSliderSpinBox::setMaximum(int newMaximum, bool computeNewFastSliderStep)
68{
69 setRange(minimum(), newMaximum, computeNewFastSliderStep);
70}
71
72void KisSliderSpinBox::setExponentRatio(double newExponentRatio)
73{
74 d->setExponentRatio(newExponentRatio);
75}
76
77void KisSliderSpinBox::setBlockUpdateSignalOnDrag(bool newBlockUpdateSignalOnDrag)
78{
79 d->setBlockUpdateSignalOnDrag(newBlockUpdateSignalOnDrag);
80}
81
82void KisSliderSpinBox::setFastSliderStep(int newFastSliderStep)
83{
84 d->setFastSliderStep(newFastSliderStep);
85}
86
88{
89 Q_UNUSED(value);
90}
91
92void KisSliderSpinBox::setSoftRange(int newSoftMinimum, int newSoftMaximum)
93{
94 d->setSoftRange(newSoftMinimum, newSoftMaximum);
95}
96
97void KisSliderSpinBox::setSoftMinimum(int newSoftMinimum)
98{
99 setSoftRange(newSoftMinimum, d->softMaximum());
100}
101
102void KisSliderSpinBox::setSoftMaximum(int newSoftMaximum)
103{
104 setSoftRange(d->softMinimum(), newSoftMaximum);
105}
106
107void KisSliderSpinBox::setInternalValue(int newValue, bool newBlockUpdateSignal)
108{
109 d->setValue(newValue, newBlockUpdateSignal);
110}
111
113{
114 setValue(newValue);
115}
116
121
124
126{
127 return d->fastSliderStep();
128}
129
131{
132 return d->softMinimum();
133}
134
136{
137 return d->softMaximum();
138}
139
141{
142 return d->isDragging();
143}
144
146{
147 return d->sizeHint();
148}
149
151{
152 return d->minimumSizeHint();
153}
154
156{
157 d->setValue(newValue);
158}
159
160void KisDoubleSliderSpinBox::setRange(double newMinimum, double newMaximum, int newNumberOfDecimals, bool computeNewFastSliderStep)
161{
162 d->setRange(newMinimum, newMaximum, newNumberOfDecimals, computeNewFastSliderStep);
163}
164
165void KisDoubleSliderSpinBox::setMinimum(double newMinimum, bool computeNewFastSliderStep)
166{
167 setRange(newMinimum, maximum(), decimals(), computeNewFastSliderStep);
168}
169
170void KisDoubleSliderSpinBox::setMaximum(double newMaximum, bool computeNewFastSliderStep)
171{
172 setRange(minimum(), newMaximum, decimals(), computeNewFastSliderStep);
173}
174
175void KisDoubleSliderSpinBox::setExponentRatio(double newExponentRatio)
176{
177 Q_ASSERT(newExponentRatio > 0.0);
178 d->setExponentRatio(newExponentRatio);
179}
180
181void KisDoubleSliderSpinBox::setBlockUpdateSignalOnDrag(bool newBlockUpdateSignalOnDrag)
182{
183 d->setBlockUpdateSignalOnDrag(newBlockUpdateSignalOnDrag);
184}
185
186void KisDoubleSliderSpinBox::setFastSliderStep(double newFastSliderStep)
187{
188 d->setFastSliderStep(newFastSliderStep);
189}
190
191void KisDoubleSliderSpinBox::setSoftRange(double newSoftMinimum, double newSoftMaximum)
192{
193 d->setSoftRange(newSoftMinimum, newSoftMaximum);
194}
195
196void KisDoubleSliderSpinBox::setSoftMinimum(double newSoftMinimum)
197{
198 setSoftRange(newSoftMinimum, d->softMaximum());
199}
200
201void KisDoubleSliderSpinBox::setSoftMaximum(double newSoftMaximum)
202{
203 setSoftRange(d->softMinimum(), newSoftMaximum);
204}
205
206void KisDoubleSliderSpinBox::setInternalValue(double newValue, bool newBlockUpdateSignal)
207{
208 d->setValue(newValue, newBlockUpdateSignal);
209}
210
212{
213 setValue(newValue);
214}
float value(const T *src, size_t ch)
The KisDoubleParseSpinBox class is a cleverer doubleSpinBox, able to parse arithmetic expressions.
This class is a spinbox in which you can click and drag to set the value. A slider like bar is displa...
void setMaximum(qreal newMaximum, bool computeNewFastSliderStep=true)
void setValue(qreal newValue)
void setRange(qreal newMinimum, qreal newMaximum, int newNumberOfDecimals=0, bool computeNewFastSliderStep=true)
Set the minimum and the maximum values of the range.
void setPrivateValue(qreal newValue)
QScopedPointer< KisSliderSpinBoxPrivate< KisDoubleSliderSpinBox, KisDoubleParseSpinBox > > d
void setBlockUpdateSignalOnDrag(bool newBlockUpdateSignalOnDrag)
void setSoftMaximum(qreal newSoftMaximum)
void setExponentRatio(qreal newExponentRatio)
void setSoftMinimum(qreal newSoftMinimum)
QSize sizeHint() const override
virtual void setInternalValue(qreal newValue, bool newBlockUpdateSignal)
void setSoftRange(qreal newSoftMinimum, qreal newSoftMaximum)
void setFastSliderStep(qreal newFastSliderStep)
void setMinimum(qreal newMinimum, bool computeNewFastSliderStep=true)
KisDoubleSliderSpinBox(QWidget *parent=nullptr)
QSize minimumSizeHint() const override
The KisIntParseSpinBox class is a cleverer SpinBox, able to parse arithmetic expressions.
This class is a spinbox in which you can click and drag to set the value. A slider like bar is displa...
int fastSliderStep() const
Get the value to which multiples the sinbox value snaps when the control key is pressed.
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 positi...
void setMinimum(int newMinimum, bool computeNewFastSliderStep=true)
Set the minimum value of the range.
void setSoftMinimum(int newSoftMinimum)
Set the minimum value of the soft range.
QSize minimumSizeHint() const override
QScopedPointer< KisSliderSpinBoxPrivate< KisSliderSpinBox, KisIntParseSpinBox > > d
void setSoftRange(int newSoftMinimum, int newSoftMaximum)
Set the minimum and the maximum values of the soft range.
void setFastSliderStep(int newFastSliderStep)
Set the value to which multiples the sinbox value snaps when the control key is pressed.
KisSliderSpinBox(QWidget *parent=nullptr)
int softMaximum() const
Get the maximum value of the "soft range".
void setPrivateValue(int value)
virtual void setInternalValue(int value, bool blockUpdateSignal)
void setValue(int newValue)
void setSoftMaximum(int newSoftMaximum)
Set the maximum value of the soft range.
void setMaximum(int newMaximum, bool computeNewFastSliderStep=true)
Set the maximum value of the range.
QSize sizeHint() const override
Set the value.
bool isDragging() const
Get if the user is currently dragging the slider with the pointer.
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 ...
void setPageStep(int newPageStep)
Does nothing currently.
int softMinimum() const
Get the minimum value of the "soft range".