QTfrontend/model/playerslistmodel.h
changeset 7731 262228c64f15
parent 7728 664738870325
child 7732 fad3408fdcc1
equal deleted inserted replaced
7730:2013733f9ca9 7731:262228c64f15
    19         Friend      = Qt::UserRole + 4,
    19         Friend      = Qt::UserRole + 4,
    20         Ignore      = Qt::UserRole + 5
    20         Ignore      = Qt::UserRole + 5
    21     };
    21     };
    22 
    22 
    23     enum SpecialRoles {
    23     enum SpecialRoles {
    24         SortRole = Qt::UserRole + 100
    24         SortRole       = Qt::UserRole + 100,
       
    25         RoomFilterRole = Qt::UserRole + 101
    25     };
    26     };
    26 
    27 
    27     explicit PlayersListModel(QObject *parent = 0);
    28     explicit PlayersListModel(QObject *parent = 0);
    28 
    29 
    29     int rowCount(const QModelIndex &parent = QModelIndex()) const;
    30     int rowCount(const QModelIndex &parent = QModelIndex()) const;
    36     bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
    37     bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex());
    37 
    38 
    38 public slots:
    39 public slots:
    39     void addPlayer(const QString & nickname);
    40     void addPlayer(const QString & nickname);
    40     void removePlayer(const QString & nickname);
    41     void removePlayer(const QString & nickname);
       
    42     void playerJoinedRoom(const QString & nickname);
       
    43     void playerLeftRoom(const QString & nickname);
    41     void setFlag(const QString & nickname, StateFlag flagType, bool isSet);
    44     void setFlag(const QString & nickname, StateFlag flagType, bool isSet);
       
    45     void resetRoomFlags();
    42 
    46 
    43 private:
    47 private:
    44     QHash<quint32, QIcon> & m_icons();
    48     QHash<quint32, QIcon> & m_icons();
    45     typedef QHash<int, QVariant> DataEntry;
    49     typedef QHash<int, QVariant> DataEntry;
    46     QList<DataEntry> m_data;
    50     QList<DataEntry> m_data;