QTfrontend/model/roomslistmodel.h
author Xeli
Sat, 28 Apr 2012 12:46:57 +0200
changeset 6950 f34ff54b0cbd
parent 6733 5abbc345a82f
child 6966 eda4f63bec41
permissions -rw-r--r--
-Fixed FingerHasMoved function, still might need a little tweaking -Fixed targetting, it's not possible to fire airstrike and the like with a longpress, however it'll fire on the cursor not on the tap location

#ifndef ROOMSLISTMODEL_H
#define ROOMSLISTMODEL_H

#include <QAbstractTableModel>
#include <QStringList>

class RoomsListModel : public QAbstractTableModel
{
    Q_OBJECT
public:
    explicit RoomsListModel(QObject *parent = 0);

    QVariant headerData(int section, Qt::Orientation orientation, int role) const;
    int rowCount(const QModelIndex & parent) const;
    int columnCount(const QModelIndex & parent) const;
    QVariant data(const QModelIndex &index, int role) const;

public slots:
    void setRoomsList(const QStringList & rooms);
    void addRoom(const QStringList & info);
    void removeRoom(const QString & name);
    void updateRoom(const QString & name, const QStringList & info);

private:
    QList<QStringList> m_data;
    QStringList m_headerData;

    QStringList roomInfo2RoomRecord(const QStringList & info);
};

#endif // ROOMSLISTMODEL_H