Krita Source Code Documentation
Loading...
Searching...
No Matches
SliderSpinBox.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2010 Justin Noel <justin@ics.com>
3 * SPDX-FileCopyrightText: 2021 Deif Lou <ginoba@gmail.com>
4 *
5 * SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7
8#ifndef LIBKIS_SLIDERSPINBOX_H
9#define LIBKIS_SLIDERSPINBOX_H
10
11#include "kis_slider_spin_box.h"
12#include "IntParseSpinBox.h"
13#include "DoubleParseSpinBox.h"
14
15#include "kritalibkis_export.h"
16#include "libkis.h"
17
18template <typename SpinBoxTypeTP, typename BaseSpinBoxTypeTP>
20
50class KRITALIBKIS_EXPORT SliderSpinBox : public IntParseSpinBox
51{
52 Q_OBJECT
53 Q_DISABLE_COPY(SliderSpinBox)
54
55
56public:
57 explicit SliderSpinBox();
58 ~SliderSpinBox() override;
59
60public Q_SLOTS:
61
68 QWidget* widget() const;
69
78 int fastSliderStep() const;
86 int softMinimum() const;
94 int softMaximum() const;
100 bool isDragging() const;
105 void setValue(int newValue);
118 void setRange(int newMinimum, int newMaximum, bool computeNewFastSliderStep = true);
129 void setMinimum(int newMinimum, bool computeNewFastSliderStep = true);
140 void setMaximum(int newMaximum, bool computeNewFastSliderStep = true);
149 void setExponentRatio(qreal newExponentRatio);
161 void setBlockUpdateSignalOnDrag(bool newBlockUpdateSignalOnDrag);
169 void setFastSliderStep(int newFastSliderStep);
179 void setSoftRange(int newSoftMinimum, int newSoftMaximum);
188 void setSoftMinimum(int newSoftMinimum);
197 void setSoftMaximum(int newSoftMaximum);
198
199Q_SIGNALS:
201
202private:
203 struct Private;
204 Private *const d;
205};
206
214class KRITALIBKIS_EXPORT DoubleSliderSpinBox : public DoubleParseSpinBox
215{
216 Q_OBJECT
217 Q_DISABLE_COPY(DoubleSliderSpinBox)
218
219public:
220 explicit DoubleSliderSpinBox();
221 ~DoubleSliderSpinBox() override;
222
223public Q_SLOTS:
224
231 QWidget* widget() const;
232
233 qreal fastSliderStep() const;
234 qreal softMinimum() const;
235 qreal softMaximum() const;
236 bool isDragging() const;
237 void setValue(qreal newValue);
252 void setRange(qreal newMinimum, qreal newMaximum, int newNumberOfDecimals = 0, bool computeNewFastSliderStep = true);
253 void setMinimum(qreal newMinimum, bool computeNewFastSliderStep = true);
254 void setMaximum(qreal newMaximum, bool computeNewFastSliderStep = true);
255 void setExponentRatio(qreal newExponentRatio);
256 void setBlockUpdateSignalOnDrag(bool newBlockUpdateSignalOnDrag);
257 void setFastSliderStep(qreal newFastSliderStep);
258 void setSoftRange(qreal newSoftMinimum, qreal newSoftMaximum);
259 void setSoftMinimum(qreal newSoftMinimum);
260 void setSoftMaximum(qreal newSoftMaximum);
261
262Q_SIGNALS:
264
265private:
266 struct Private;
267 Private *const d;
268};
269
270#endif // LIBKIS_SLIDERSPINBOX_H
A wrapper around KisDoubleParseSpinBox, which is a cleverer doubleSpinBox, able to parse arithmetic e...
This class is a wrapper around KisDoubleSliderSpinBox, a spinbox in which you can click and drag to s...
A wrapper around KisIntParseSpinBox, which is a cleverer SpinBox, able to parse arithmetic expression...
QSpinBox * widget() const
Get the internal KisIntParseSpinBox as a QWidget, so it may be added to a UI.
void setValue(int value, bool overwriteExpression=false)
Set the value of the spinbox.
This class is a wrapper around KisSliderSpinBox, a spinbox in which you can click and drag to set the...
void draggingFinished()
Private *const d