-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathDial.h
More file actions
33 lines (29 loc) · 707 Bytes
/
Dial.h
File metadata and controls
33 lines (29 loc) · 707 Bytes
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
#pragma once
#include <QFrame>
#include <QMainWindow>
#include <QDial>
#include <QLabel>
namespace Examples {
class Window1 : public QMainWindow {
Q_OBJECT
public:
Window1() {
dial1.setMaximum(200);
dial1.setValue(100);
dial1.move(10, 10);
connect(&dial1, &QDial::valueChanged, [&] {
label1.setText(QString("%1").arg(dial1.value()));
});
label1.move(10, 150);
label1.resize(200, 20);
label1.setText(QString("%1").arg(dial1.value()));
setCentralWidget(&frame);
setWindowTitle("Dial example");
resize(300, 300);
}
private:
QFrame frame;
QDial dial1 {&frame};
QLabel label1 {&frame};
};
}