EvidenceType.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #include <QObject>
  2. #ifndef EVIDENCETYPE_H
  3. #define EVIDENCETYPE_H
  4. class EvidenceType : public QObject
  5. {
  6. Q_OBJECT
  7. public:
  8. EvidenceType() : _id(0), _color("grey"), _colorcode("#ffffff") ,_description(""), _number(0), _image("") {}
  9. EvidenceType(QString color, QString colorcode, int number, QString image = "") {
  10. _color = color;
  11. _colorcode = colorcode;
  12. _description = "";
  13. _number = number;
  14. _image = image;
  15. emit typeChanged();
  16. };
  17. Q_PROPERTY(int id READ id WRITE setId NOTIFY typeChanged)
  18. int id() { return _id; }
  19. Q_PROPERTY(QString color READ color NOTIFY typeChanged)
  20. QString color() { return _color; }
  21. Q_PROPERTY(QString colorcode READ colorcode NOTIFY typeChanged)
  22. QString colorcode() { return _colorcode; }
  23. Q_PROPERTY(QString description READ description NOTIFY typeChanged)
  24. QString description() { return _description; }
  25. Q_PROPERTY(int number READ number NOTIFY typeChanged)
  26. int number() { return _number; }
  27. Q_PROPERTY(QString image READ image NOTIFY typeChanged)
  28. QString image() { return _image; }
  29. void setId(int id) { if(id == _id) return; _id = id; emit typeChanged(); }
  30. void setDescription(QString description) { _description = description; emit typeChanged(); }
  31. signals:
  32. void typeChanged();
  33. private:
  34. int _id;
  35. QString _color;
  36. QString _colorcode;
  37. QString _description;
  38. int _number;
  39. QString _image;
  40. };
  41. #endif // EVIDENCETYPE_H