-
Notifications
You must be signed in to change notification settings - Fork 19
/
Monitor.h
executable file
·50 lines (40 loc) · 888 Bytes
/
Monitor.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
#ifndef MONITOR_H
#define MONITOR_H
#include <QWidget>
#include <QLabel>
#include <QVBoxLayout>
#include <QTimer>
#include <Simulation.h>
#include <GuiConstants.h>
#include <QPalette>
#include <QKeyEvent>
class Monitor : public QWidget
{
Q_OBJECT
public:
explicit Monitor(Simulation* sim, QWidget *parent = 0, int refreshRate = 0);
~Monitor();
void setSimulation(Simulation* sim);
void onResize(int w, int h);
signals:
public slots:
void updateSlot(void);
protected:
void keyPressEvent(QKeyEvent *event)
{
if(event->key()==Qt::Key_A)
{
std::cout << "jcsuej" << std::endl;
move(0,50);
}
}
private:
Simulation* m_sim;
QTimer* m_timer;
int m_refreshRate;
QVBoxLayout* mainLayout;
//QFrame* bottomFrame;
QLabel* titleLabel;
QLabel* timeLabel;
};
#endif // MONITOR_H