smilesitemmodel.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef SMILESITEMMODEL_H
  2. #define SMILESITEMMODEL_H
  3. #include "listmodel.h"
  4. class SmilesItemModel : public ListItem
  5. {
  6. Q_OBJECT
  7. public:
  8. enum Roles {
  9. smPicture = Qt::UserRole+1,
  10. smText
  11. };
  12. explicit SmilesItemModel( QObject *parent = 0 ): ListItem(parent) {
  13. m_picture = "";
  14. m_text = "";
  15. }
  16. explicit SmilesItemModel( const QString &_smilePicture,
  17. const QString &_smileText,
  18. QObject *parent = 0 );
  19. virtual QVariant data(int role) const;
  20. virtual QHash<int, QByteArray> roleNames() const;
  21. virtual QString id() const { return m_text; }
  22. void setPicture( const QString &_smilePicture );
  23. void setText( const QString &_smileText );
  24. inline QString picture() const { return m_picture; }
  25. inline QString text() const { return m_text; }
  26. void copy( const SmilesItemModel* );
  27. signals:
  28. public slots:
  29. private:
  30. QString m_picture;
  31. QString m_text;
  32. };
  33. #endif // SMILESITEMMODEL_H