Pencil2D Animation
Download Community News Docs Contribute
  • Overview
  • Articles
  • Code
  •  
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • File List
Loading...
Searching...
No Matches
  • app
  • src
spinslider.h
1/*
2
3Pencil2D - Traditional Animation Software
4Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5Copyright (C) 2012-2020 Matthew Chiawen Chang
6
7This program is free software; you can redistribute it and/or
8modify it under the terms of the GNU General Public License
9as published by the Free Software Foundation; version 2 of the License.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16*/
17
18
19#ifndef SPINSLIDER_H
20#define SPINSLIDER_H
21
22#include <QWidget>
23
24class QLabel;
25class QSlider;
26class QStyle;
27
28
29class SpinSlider : public QWidget
30{
31 Q_OBJECT
32public:
33 enum GROWTH_TYPE
34 {
35 LINEAR,
36 LOG,
37 EXPONENT,
38 };
39
40 enum VALUE_TYPE
41 {
42 INTEGER,
43 FLOAT,
44 };
45 SpinSlider(QWidget* parent = nullptr);
46 void init(QString text, GROWTH_TYPE, qreal min, qreal max);
47 void setValue(qreal);
48 void setPixelPos(qreal min, qreal max, int val, int space, bool upsideDown);
49 void setExponent(const qreal);
50 void setLabel(QString newText);
51 void setRange(qreal min, qreal max);
52
53signals:
54 void valueChanged(qreal);
55
56private:
57 void onSliderValueChanged(int);
58 void changeValue(qreal);
59
60private:
61 QSlider* mSlider = nullptr;
62 qreal mValue = 50.0;
63 qreal mMin = 0.1;
64 qreal mMax = 100.0;
65 qreal mExp = 2.0;
66 QString mText = "";
67 QLabel* mLabel = nullptr;
68
69 GROWTH_TYPE mGrowthType = LINEAR;
70};
71
72#endif // SPINSLIDER_H
SpinSlider
Definition: spinslider.h:30
QLabel
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QObject::parent
QObject * parent() const const
QSlider
QString
QStyle
QWidget
Generated on Tue Jan 6 2026 11:38:51 for Pencil2D by doxygen 1.9.6 based on revision f91a96748ec6712509b9b0ff47979db9c34d556f