TopPlayerData.h 826 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include <QObject>
  2. #ifndef TOPPLAYERDATA_H
  3. #define TOPPLAYERDATA_H
  4. class TopPlayerData : public QObject {
  5. Q_OBJECT
  6. public:
  7. TopPlayerData(QString name="", QString score="", QString position="") : _name(""), _score(""), _position("") {
  8. _name = name;
  9. _score = score;
  10. _position = position;
  11. emit dataChanged();
  12. }
  13. Q_PROPERTY(QString name READ name NOTIFY dataChanged())
  14. QString name() const { return _name; }
  15. Q_PROPERTY(QString score READ score NOTIFY dataChanged())
  16. QString score() const { return _score; }
  17. Q_PROPERTY(QString position READ position NOTIFY dataChanged())
  18. QString position() const { return _position; }
  19. signals:
  20. void dataChanged();
  21. private:
  22. QString _name;
  23. QString _score;
  24. QString _position;
  25. };
  26. #endif // TOPPLAYERDATA_H