-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhexator.h
47 lines (35 loc) · 892 Bytes
/
hexator.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
#ifndef HEXATOR_H
#define HEXATOR_H
#include <QWidget>
#include <QPushButton>
#include <QLineEdit>
class QLineEdit;
class QPushButton;
enum Mode { NotSet, Addition, Subtraction };
class Hexator : public QWidget
{
Q_OBJECT
public:
Hexator(QWidget *parent = 0);
private slots:
void changeModeToAdd();
void changeModeToSub();
void pressDigit();
void clear();
void calculate();
private:
QLineEdit *display;
QPushButton *addButton;
QPushButton *subButton;
QPushButton *assignButton;
QPushButton *clearButton;
QPushButton *digitButtons[16];
QPushButton *createButton(const QString &text, const char *member, bool isOperand = false, bool isChar = false);
void customizeDisplay();
void setDisplayNumber(long number);
long getNumberFromDisplay();
Mode currentMode;
long savedNum;
bool lastButtonWasMode;
};
#endif // HEXATOR_H