-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQTUtils.h
72 lines (56 loc) · 1.68 KB
/
QTUtils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// **************************************************
// QTUtils module.
// Author : Tamy Boubekeur ([email protected]).
// Copyright (C) 2008 Tamy Boubekeur.
// All rights reserved.
// **************************************************
#ifndef QTUTILS_H
#define QTUTILS_H
#include <QApplication>
#include <QLabel>
#include <QSlider>
#include <QLCDNumber>
class IntegerWidget : public QWidget {
Q_OBJECT
public:
IntegerWidget (const QString & name, int minValue, int maxValue, int value,
QWidget * parent = NULL);
virtual ~IntegerWidget ();
QString getName () const { return label->text (); }
int getMin () const { return slider->minimum (); }
int getMax () const { return slider->minimum (); }
int getValue () const { return slider->value (); }
signals:
void valueChanged (int);
private:
QLabel * label;
QSlider * slider;
QLCDNumber * LCDNumber;
};
class DoubleWidget : public QWidget {
Q_OBJECT
public:
DoubleWidget (const QString & name, double minValue, double maxValue, double value,
QWidget * parent = NULL);
virtual ~DoubleWidget ();
QString getName () const { return label->text (); }
double getMin () const { return slider->minimum (); }
double getMax () const { return slider->minimum (); }
double getValue () const { return slider->value (); }
signals:
void valueChanged (double);
private slots:
void changeValue (int i);
private:
QLabel * label;
QSlider * slider;
QLCDNumber * LCDNumber;
};
void setBoubekQTStyle (QApplication & app);
#endif // QTUTILS_H
// Some Emacs-Hints -- please don't remove:
//
// Local Variables:
// mode:C++
// tab-width:4
// End: