QTfrontend/netserverslist.cpp
changeset 668 0d7683a66d61
parent 665 5c7bfc8bac6a
child 883 07a568ba44e0
equal deleted inserted replaced
667:194dc62d1519 668:0d7683a66d61
    29 
    29 
    30 void HWNetServersModel::updateList()
    30 void HWNetServersModel::updateList()
    31 {
    31 {
    32 
    32 
    33 }
    33 }
       
    34 
       
    35 QVariant HWNetServersModel::headerData(int section,
       
    36             Qt::Orientation orientation, int role) const
       
    37 {
       
    38 	if (role != Qt::DisplayRole)
       
    39 		return QVariant();
       
    40 
       
    41 	if (orientation == Qt::Horizontal)
       
    42 	{
       
    43 		switch (section)
       
    44 		{
       
    45 			case 0: return tr("Title");
       
    46 			case 1: return tr("IP");
       
    47 			case 2: return tr("Port");
       
    48 			default: return QVariant();
       
    49 		}
       
    50 	} else
       
    51 		return QString("%1").arg(section + 1);
       
    52 }
       
    53 
       
    54 int HWNetServersModel::rowCount(const QModelIndex &parent) const
       
    55 {
       
    56 	if (parent.isValid())
       
    57 		return 0;
       
    58 	else
       
    59 		return games.size();
       
    60 }
       
    61 
       
    62 int HWNetServersModel::columnCount(const QModelIndex & parent) const
       
    63 {
       
    64 	if (parent.isValid())
       
    65 		return 0;
       
    66 	else
       
    67 		return 3;
       
    68 }