EvidenceInfo.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #include <QObject>
  2. #include "TileData.h"
  3. #ifndef EVIDENCEINFO_H
  4. #define EVIDENCEINFO_H
  5. class EvidenceInfo : public QObject
  6. {
  7. Q_OBJECT
  8. public:
  9. EvidenceInfo() : _title(""), _type(new EvidenceType), _description(""), _image(""), _isVisible(false) {}
  10. Q_PROPERTY(QString title READ title NOTIFY evidenceChanged)
  11. QString title() const { return _title; }
  12. Q_PROPERTY(QString color READ color NOTIFY evidenceChanged)
  13. QString color() const { return _type->colorcode(); }
  14. Q_PROPERTY(QString description READ description NOTIFY evidenceChanged)
  15. QString description() const { return _description; }
  16. Q_PROPERTY(QString image READ image NOTIFY evidenceChanged)
  17. QString image() const { return _image == "" ? "empty.png" : _image; }
  18. Q_PROPERTY(bool visible READ visible NOTIFY evidenceChanged)
  19. bool visible() const { return _isVisible; }
  20. void loadEvidence(TileData *t);
  21. void loadCustomMessage(QString, EvidenceType*, QString, QString);
  22. public slots:
  23. Q_INVOKABLE void setVisible(bool visible) { _isVisible = visible; emit evidenceChanged(); }
  24. signals:
  25. void evidenceChanged();
  26. private:
  27. QString _title;
  28. EvidenceType* _type;
  29. QString _description;
  30. QString _image;
  31. bool _isVisible;
  32. };
  33. #endif // EVIDENCEINFO_H