author | František Kučera <franta-hg@frantovo.cz> |
Thu, 24 Oct 2019 21:51:08 +0200 | |
branch | v_0 |
changeset 10 | da93f3667a52 |
parent 6 | f81d43b74209 |
permissions | -rw-r--r-- |
1 | 1 |
/** |
2 |
* Spacenav Simulator Qt |
|
3 |
* Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info) |
|
4 |
* |
|
5 |
* This program is free software: you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
10
da93f3667a52
fix license version: GNU GPLv3
František Kučera <franta-hg@frantovo.cz>
parents:
6
diff
changeset
|
7 |
* the Free Software Foundation, version 3 of the License. |
1 | 8 |
* |
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
16 |
*/ |
|
17 |
#pragma once |
|
18 |
||
19 |
#include <vector> |
|
4 | 20 |
#include <QMainWindow> |
21 |
#include <QCheckBox> |
|
22 |
#include <QSlider> |
|
23 |
#include <QPushButton> |
|
6
f81d43b74209
Option: Periodic updates (each 20 ms)
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
24 |
#include <QTimer> |
1 | 25 |
|
2
a27850958a67
emit button and motion events
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
26 |
#include "MotionEvent.h" |
a27850958a67
emit button and motion events
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
27 |
#include "ButtonEvent.h" |
a27850958a67
emit button and motion events
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
28 |
|
1 | 29 |
class SimulatorWindow : public QMainWindow { |
30 |
Q_OBJECT |
|
31 |
public: |
|
32 |
SimulatorWindow(); |
|
33 |
SimulatorWindow(const SimulatorWindow& orig); |
|
34 |
virtual ~SimulatorWindow(); |
|
2
a27850958a67
emit button and motion events
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
35 |
signals: |
3
42d64bd73232
connect slots, print events to stdout
František Kučera <franta-hg@frantovo.cz>
parents:
2
diff
changeset
|
36 |
void motionEvent(MotionEvent e); |
42d64bd73232
connect slots, print events to stdout
František Kučera <franta-hg@frantovo.cz>
parents:
2
diff
changeset
|
37 |
void buttonEvent(ButtonEvent e); |
1 | 38 |
private: |
39 |
std::vector<QCheckBox*> buttons; |
|
40 |
std::vector<QSlider*> motions; |
|
41 |
std::vector<QSlider*> rotations; |
|
42 |
QPushButton* centerButton; |
|
6
f81d43b74209
Option: Periodic updates (each 20 ms)
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
43 |
QCheckBox* periodicButton; |
1 | 44 |
QSlider* createSlider(QWidget* parent); |
6
f81d43b74209
Option: Periodic updates (each 20 ms)
František Kučera <franta-hg@frantovo.cz>
parents:
4
diff
changeset
|
45 |
QTimer* timer; |
1 | 46 |
|
47 |
private slots: |
|
48 |
void centerAll(); |
|
2
a27850958a67
emit button and motion events
František Kučera <franta-hg@frantovo.cz>
parents:
1
diff
changeset
|
49 |
void sendMotionEvent(); |
1 | 50 |
}; |