smthemeitemmodel.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef SMILETHEMESITEMMODEL_H
  2. #define SMILETHEMESITEMMODEL_H
  3. #include "listmodel.h"
  4. class SmilesThemeItemModel : public ListItem
  5. {
  6. Q_OBJECT
  7. public:
  8. enum Roles {
  9. smName = Qt::UserRole+1,
  10. smFile,
  11. smAuthor,
  12. smPicture
  13. };
  14. explicit SmilesThemeItemModel( QObject *parent = 0 ): ListItem(parent) {
  15. m_file = "";
  16. m_name = "";
  17. m_author = "";
  18. m_picture = "";
  19. }
  20. explicit SmilesThemeItemModel( const QString &_themeSmName,
  21. const QString &_themeSmFile,
  22. const QString &_themeSmAuthor,
  23. const QString &_themeSmPicture,
  24. QObject *parent = 0 );
  25. virtual QVariant data( int role ) const;
  26. virtual QHash<int, QByteArray> roleNames() const;
  27. virtual QString id() const { return m_file; }
  28. void setName( const QString &_smileThemeName );
  29. void setFile( const QString &_smileThemeFile );
  30. void setAuthor( const QString &_smileThemeAuthor );
  31. void setPicture( const QString &_smileThemePicture );
  32. inline QString file() const { return m_file; }
  33. inline QString name() const { return m_name; }
  34. inline QString author() const { return m_author; }
  35. inline QString picture() const { return m_picture; }
  36. signals:
  37. public slots:
  38. private:
  39. QString m_name;
  40. QString m_file;
  41. QString m_author;
  42. QString m_picture;
  43. };
  44. #endif // SMILETHEMESITEMMODEL_H