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, VALUE_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
52signals:
53 void valueChanged(qreal);
54
55private:
56 void onSliderValueChanged(int);
57 void changeValue(qreal);
58
59private:
60 QSlider* mSlider = nullptr;
61 qreal mValue = 50.0;
62 qreal mMin = 0.1;
63 qreal mMax = 100.0;
64 qreal mExp = 2.0;
65 QString mText = "";
66 QLabel* mLabel = nullptr;
67
68 GROWTH_TYPE mGrowthType = LINEAR;
69 VALUE_TYPE mValueType = INTEGER;
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 Thu May 8 2025 04:47:53 for Pencil2D by doxygen 1.9.6 based on revision 4513250b1d5b1a3676ec0e67b06b7a885ceaae39