QTfrontend/model/playerslistmodel.cpp
author unc0rr
Sat, 06 Oct 2012 01:09:41 +0400
changeset 7723 ca05b576ec74
child 7725 4ad05a478c6c
permissions -rw-r--r--
Start moving to players list model.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7723
ca05b576ec74 Start moving to players list model.
unc0rr
parents:
diff changeset
     1
#include "playerslistmodel.h"
ca05b576ec74 Start moving to players list model.
unc0rr
parents:
diff changeset
     2
ca05b576ec74 Start moving to players list model.
unc0rr
parents:
diff changeset
     3
PlayersListModel::PlayersListModel(QObject *parent) :
ca05b576ec74 Start moving to players list model.
unc0rr
parents:
diff changeset
     4
    QStringListModel(parent)
ca05b576ec74 Start moving to players list model.
unc0rr
parents:
diff changeset
     5
{
ca05b576ec74 Start moving to players list model.
unc0rr
parents:
diff changeset
     6
ca05b576ec74 Start moving to players list model.
unc0rr
parents:
diff changeset
     7
}
ca05b576ec74 Start moving to players list model.
unc0rr
parents:
diff changeset
     8
ca05b576ec74 Start moving to players list model.
unc0rr
parents:
diff changeset
     9
void PlayersListModel::addPlayer(const QString & nickname)
ca05b576ec74 Start moving to players list model.
unc0rr
parents:
diff changeset
    10
{
ca05b576ec74 Start moving to players list model.
unc0rr
parents:
diff changeset
    11
    insertRows(rowCount(), 1);
ca05b576ec74 Start moving to players list model.
unc0rr
parents:
diff changeset
    12
ca05b576ec74 Start moving to players list model.
unc0rr
parents:
diff changeset
    13
    setData(index(rowCount() - 1), nickname);
ca05b576ec74 Start moving to players list model.
unc0rr
parents:
diff changeset
    14
}