Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_slider_spin_box.h
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: 2021 Deif Lou <ginoba@gmail.com>
5 *
6 * SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8
9#ifndef KISSLIDERSPINBOX_H
10#define KISSLIDERSPINBOX_H
11
12#include <QScopedPointer>
13
16
17#include <kritawidgetutils_export.h>
18
19template <typename SpinBoxTypeTP, typename BaseSpinBoxTypeTP>
21
50class KRITAWIDGETUTILS_EXPORT KisSliderSpinBox : public KisIntParseSpinBox
51{
52 Q_OBJECT
53public:
54 KisSliderSpinBox(QWidget * parent = nullptr);
55 ~KisSliderSpinBox() override;
56
65 int fastSliderStep() const;
73 int softMinimum() const;
81 int softMaximum() const;
87 bool isDragging() const;
92 QSize sizeHint() const override;
93 QSize minimumSizeHint() const override;
94 void setValue(int newValue);
107 void setRange(int newMinimum, int newMaximum, bool computeNewFastSliderStep = true);
118 void setMinimum(int newMinimum, bool computeNewFastSliderStep = true);
129 void setMaximum(int newMaximum, bool computeNewFastSliderStep = true);
138 void setExponentRatio(qreal newExponentRatio);
150 void setBlockUpdateSignalOnDrag(bool newBlockUpdateSignalOnDrag);
158 void setFastSliderStep(int newFastSliderStep);
162 void setPageStep(int newPageStep);
172 void setSoftRange(int newSoftMinimum, int newSoftMaximum);
181 void setSoftMinimum(int newSoftMinimum);
190 void setSoftMaximum(int newSoftMaximum);
191
192Q_SIGNALS:
194
195protected:
196 virtual void setInternalValue(int value, bool blockUpdateSignal);
197 void setPrivateValue(int value);
198
199private:
200 template <typename SpinBoxTypeTP, typename BaseSpinBoxTypeTP>
202 QScopedPointer<KisSliderSpinBoxPrivate<KisSliderSpinBox, KisIntParseSpinBox>> d;
203};
204
211class KRITAWIDGETUTILS_EXPORT KisDoubleSliderSpinBox : public KisDoubleParseSpinBox
212{
213 Q_OBJECT
214public:
215 KisDoubleSliderSpinBox(QWidget * parent = nullptr);
216 ~KisDoubleSliderSpinBox() override;
217
218 qreal fastSliderStep() const;
219 qreal softMinimum() const;
220 qreal softMaximum() const;
221 bool isDragging() const;
222 QSize sizeHint() const override;
223 QSize minimumSizeHint() const override;
224 void setValue(qreal newValue);
239 void setRange(qreal newMinimum, qreal newMaximum, int newNumberOfDecimals = 0, bool computeNewFastSliderStep = true);
240 void setMinimum(qreal newMinimum, bool computeNewFastSliderStep = true);
241 void setMaximum(qreal newMaximum, bool computeNewFastSliderStep = true);
242 void setExponentRatio(qreal newExponentRatio);
243 void setBlockUpdateSignalOnDrag(bool newBlockUpdateSignalOnDrag);
244 void setFastSliderStep(qreal newFastSliderStep);
245 void setSoftRange(qreal newSoftMinimum, qreal newSoftMaximum);
246 void setSoftMinimum(qreal newSoftMinimum);
247 void setSoftMaximum(qreal newSoftMaximum);
248
249protected:
250 virtual void setInternalValue(qreal newValue, bool newBlockUpdateSignal);
251 void setPrivateValue(qreal newValue);
252
253Q_SIGNALS:
255
256private:
257 template <typename SpinBoxTypeTP, typename BaseSpinBoxTypeTP>
259 QScopedPointer<KisSliderSpinBoxPrivate<KisDoubleSliderSpinBox, KisDoubleParseSpinBox>> d;
260};
261
262#endif // KISSLIDERSPINBOX_H
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...
QScopedPointer< KisSliderSpinBoxPrivate< KisDoubleSliderSpinBox, KisDoubleParseSpinBox > > d
The KisIntParseSpinBox class is a cleverer SpinBox, able to parse arithmetic expressions.
void setValue(int value, bool overwriteExpression=false)
Set the value of the spinbox.
This class is a spinbox in which you can click and drag to set the value. A slider like bar is displa...
void draggingFinished()
QScopedPointer< KisSliderSpinBoxPrivate< KisSliderSpinBox, KisIntParseSpinBox > > d