QTfrontend/model/roomslistmodel.h
author nemo
Fri, 23 Mar 2012 18:20:59 -0400
changeset 6810 5337f554480e
parent 6733 5abbc345a82f
child 6966 eda4f63bec41
permissions -rw-r--r--
This has bugged me for a while. Since we are missing the source SVGs for this theme, removed the leaves crudely in GIMP. Also added some basic roots. Someone more artistic is encouraged to try and improve it.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6732
c906dc78091f Start switching to rooms list model. To be continued.
unc0rr
parents:
diff changeset
     1
#ifndef ROOMSLISTMODEL_H
c906dc78091f Start switching to rooms list model. To be continued.
unc0rr
parents:
diff changeset
     2
#define ROOMSLISTMODEL_H
c906dc78091f Start switching to rooms list model. To be continued.
unc0rr
parents:
diff changeset
     3
c906dc78091f Start switching to rooms list model. To be continued.
unc0rr
parents:
diff changeset
     4
#include <QAbstractTableModel>
c906dc78091f Start switching to rooms list model. To be continued.
unc0rr
parents:
diff changeset
     5
#include <QStringList>
c906dc78091f Start switching to rooms list model. To be continued.
unc0rr
parents:
diff changeset
     6
c906dc78091f Start switching to rooms list model. To be continued.
unc0rr
parents:
diff changeset
     7
class RoomsListModel : public QAbstractTableModel
c906dc78091f Start switching to rooms list model. To be continued.
unc0rr
parents:
diff changeset
     8
{
c906dc78091f Start switching to rooms list model. To be continued.
unc0rr
parents:
diff changeset
     9
    Q_OBJECT
c906dc78091f Start switching to rooms list model. To be continued.
unc0rr
parents:
diff changeset
    10
public:
c906dc78091f Start switching to rooms list model. To be continued.
unc0rr
parents:
diff changeset
    11
    explicit RoomsListModel(QObject *parent = 0);
c906dc78091f Start switching to rooms list model. To be continued.
unc0rr
parents:
diff changeset
    12
c906dc78091f Start switching to rooms list model. To be continued.
unc0rr
parents:
diff changeset
    13
    QVariant headerData(int section, Qt::Orientation orientation, int role) const;
c906dc78091f Start switching to rooms list model. To be continued.
unc0rr
parents:
diff changeset
    14
    int rowCount(const QModelIndex & parent) const;
c906dc78091f Start switching to rooms list model. To be continued.
unc0rr
parents:
diff changeset
    15
    int columnCount(const QModelIndex & parent) const;
c906dc78091f Start switching to rooms list model. To be continued.
unc0rr
parents:
diff changeset
    16
    QVariant data(const QModelIndex &index, int role) const;
c906dc78091f Start switching to rooms list model. To be continued.
unc0rr
parents:
diff changeset
    17
6733
5abbc345a82f Handle ROOM* commands in rooms list model
unc0rr
parents: 6732
diff changeset
    18
public slots:
5abbc345a82f Handle ROOM* commands in rooms list model
unc0rr
parents: 6732
diff changeset
    19
    void setRoomsList(const QStringList & rooms);
5abbc345a82f Handle ROOM* commands in rooms list model
unc0rr
parents: 6732
diff changeset
    20
    void addRoom(const QStringList & info);
5abbc345a82f Handle ROOM* commands in rooms list model
unc0rr
parents: 6732
diff changeset
    21
    void removeRoom(const QString & name);
5abbc345a82f Handle ROOM* commands in rooms list model
unc0rr
parents: 6732
diff changeset
    22
    void updateRoom(const QString & name, const QStringList & info);
5abbc345a82f Handle ROOM* commands in rooms list model
unc0rr
parents: 6732
diff changeset
    23
6732
c906dc78091f Start switching to rooms list model. To be continued.
unc0rr
parents:
diff changeset
    24
private:
c906dc78091f Start switching to rooms list model. To be continued.
unc0rr
parents:
diff changeset
    25
    QList<QStringList> m_data;
c906dc78091f Start switching to rooms list model. To be continued.
unc0rr
parents:
diff changeset
    26
    QStringList m_headerData;
6733
5abbc345a82f Handle ROOM* commands in rooms list model
unc0rr
parents: 6732
diff changeset
    27
5abbc345a82f Handle ROOM* commands in rooms list model
unc0rr
parents: 6732
diff changeset
    28
    QStringList roomInfo2RoomRecord(const QStringList & info);
6732
c906dc78091f Start switching to rooms list model. To be continued.
unc0rr
parents:
diff changeset
    29
};
c906dc78091f Start switching to rooms list model. To be continued.
unc0rr
parents:
diff changeset
    30
c906dc78091f Start switching to rooms list model. To be continued.
unc0rr
parents:
diff changeset
    31
#endif // ROOMSLISTMODEL_H