6732
|
1 |
#ifndef ROOMSLISTMODEL_H
|
|
2 |
#define ROOMSLISTMODEL_H
|
|
3 |
|
|
4 |
#include <QAbstractTableModel>
|
|
5 |
#include <QStringList>
|
|
6 |
|
|
7 |
class RoomsListModel : public QAbstractTableModel
|
|
8 |
{
|
|
9 |
Q_OBJECT
|
|
10 |
public:
|
|
11 |
explicit RoomsListModel(QObject *parent = 0);
|
|
12 |
|
|
13 |
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
|
|
14 |
int rowCount(const QModelIndex & parent) const;
|
|
15 |
int columnCount(const QModelIndex & parent) const;
|
|
16 |
QVariant data(const QModelIndex &index, int role) const;
|
|
17 |
|
6733
|
18 |
public slots:
|
|
19 |
void setRoomsList(const QStringList & rooms);
|
|
20 |
void addRoom(const QStringList & info);
|
|
21 |
void removeRoom(const QString & name);
|
|
22 |
void updateRoom(const QString & name, const QStringList & info);
|
|
23 |
|
6732
|
24 |
private:
|
|
25 |
QList<QStringList> m_data;
|
|
26 |
QStringList m_headerData;
|
6733
|
27 |
|
|
28 |
QStringList roomInfo2RoomRecord(const QStringList & info);
|
6732
|
29 |
};
|
|
30 |
|
|
31 |
#endif // ROOMSLISTMODEL_H
|