-
Notifications
You must be signed in to change notification settings - Fork 1
/
mpre.h
45 lines (37 loc) · 1.08 KB
/
mpre.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
/*!
* \file mpre.h
* \author Simon Coakley
* \date 2012
* \copyright Copyright (c) 2012 University of Sheffield
* \brief Header file for mpre
*/
#ifndef MPRE_H_
#define MPRE_H_
#include <QMetaType>
#include <QPainter>
class Mpre {
public:
enum EditMode { Editable, ReadOnly };
Mpre(QString n = "", QString o = "==", int v = 0,
bool enabled = false, bool neg = false);
void paint(QPainter *painter, const QRect &rect,
const QPalette &palette, EditMode mode) const;
QString name() const { return myName; }
QString op() const { return myOp; }
int value() const { return myValue; }
void setName(QString n) { myName = n; }
void setOp(QString o) { myOp = o; }
void setValue(int v) { myValue = v; }
bool enabled() const { return myEnabled; }
void setEnabled(bool enabled) { myEnabled = enabled; }
void setNot(bool n) { myNot = n; }
bool isNot() const { return myNot; }
private:
bool myEnabled;
bool myNot;
QString myName;
QString myOp;
int myValue;
};
Q_DECLARE_METATYPE(Mpre)
#endif // MPRE_H_