QTfrontend/hats.h
changeset 1239 4901abe4c3b0
parent 1238 914bd2a9a249
child 2948 3f21a9dc93d0
equal deleted inserted replaced
1238:914bd2a9a249 1239:4901abe4c3b0
    17  */
    17  */
    18 
    18 
    19 #ifndef _HATS_INCLUDED
    19 #ifndef _HATS_INCLUDED
    20 #define _HATS_INCLUDED
    20 #define _HATS_INCLUDED
    21 
    21 
    22 #include <QAbstractTableModel>
    22 #include <QAbstractListModel>
    23 #include <QStringList>
    23 #include <QStringList>
       
    24 #include <QVector>
       
    25 #include <QPair>
       
    26 #include <QIcon>
    24 
    27 
    25 class HatsModel : public QAbstractTableModel
    28 class HatsModel : public QAbstractListModel
    26 {
    29 {
    27 	Q_OBJECT
    30 	Q_OBJECT
    28 
    31 
    29 public:
    32 public:
    30 	HatsModel(QObject *parent = 0);
    33 	HatsModel(QObject *parent = 0);
    31 
    34 
    32 	QVariant headerData(int section, Qt::Orientation orientation, int role) const;
    35 	QVariant headerData(int section, Qt::Orientation orientation, int role) const;
    33 	int rowCount(const QModelIndex & parent) const;
    36 	int rowCount(const QModelIndex & parent) const;
    34 	int columnCount(const QModelIndex & parent) const;
    37 	//int columnCount(const QModelIndex & parent) const;
    35 
    38 
    36 	QVariant data(const QModelIndex &index, int role) const;
    39 	QVariant data(const QModelIndex &index, int role) const;
    37 //protected:
    40 protected:
    38 //	QList<QStringList> games;
    41 	QVector<QPair<QString, QIcon> > hats;
    39 };
    42 };
    40 
    43 
    41 #endif // _HATS_INCLUDED
    44 #endif // _HATS_INCLUDED