forked from condo4/carbudget
-
Notifications
You must be signed in to change notification settings - Fork 0
/
carevent.h
45 lines (33 loc) · 1 KB
/
carevent.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
#ifndef CAREVENT_H
#define CAREVENT_H
#include <QObject>
#include <QDate>
class Car;
class CarEvent : public QObject
{
Q_OBJECT
Q_PROPERTY(QDateTime date READ date WRITE setDate NOTIFY dateChanged )
Q_PROPERTY(unsigned int distance READ distance WRITE setDistance NOTIFY distanceChanged )
Q_PROPERTY(unsigned int id READ id NOTIFY idChanged )
protected:
Car *_car;
QDate _date;
unsigned int _distance;
unsigned int _eventid;
public:
explicit CarEvent(Car *parent = 0);
explicit CarEvent(QDate date, unsigned int distance, unsigned int eventid, Car *parent = 0);
unsigned int saveevent();
bool delevent();
int id() const;
signals:
void dateChanged();
void distanceChanged();
void idChanged();
public slots:
QDateTime date() const;
void setDate(QDateTime date);
unsigned int distance() const;
void setDistance(unsigned int distance);
};
#endif // CAREVENT_H