QTfrontend/netwwwwidget.cpp
changeset 668 0d7683a66d61
parent 665 5c7bfc8bac6a
child 883 07a568ba44e0
equal deleted inserted replaced
667:194dc62d1519 668:0d7683a66d61
    41 		|| index.row() >= games.size()
    41 		|| index.row() >= games.size()
    42 		|| role != Qt::DisplayRole)
    42 		|| role != Qt::DisplayRole)
    43 	return QVariant();
    43 	return QVariant();
    44 
    44 
    45 	return games[index.row()][index.column()];
    45 	return games[index.row()][index.column()];
    46 }
       
    47 
       
    48 QVariant HWNetWwwModel::headerData(int section,
       
    49             Qt::Orientation orientation, int role) const
       
    50 {
       
    51 	if (role != Qt::DisplayRole)
       
    52 		return QVariant();
       
    53 
       
    54 	if (orientation == Qt::Horizontal)
       
    55 	{
       
    56 		switch (section)
       
    57 		{
       
    58 			case 0: return tr("Title");
       
    59 			case 1: return tr("IP");
       
    60 			case 2: return tr("Port");
       
    61 			default: return QVariant();
       
    62 		}
       
    63 	} else
       
    64 		return QString("%1").arg(section + 1);
       
    65 }
       
    66 
       
    67 int HWNetWwwModel::rowCount(const QModelIndex &parent) const
       
    68 {
       
    69 	if (parent.isValid())
       
    70 		return 0;
       
    71 	else
       
    72 		return games.size();
       
    73 }
       
    74 
       
    75 int HWNetWwwModel::columnCount(const QModelIndex & parent) const
       
    76 {
       
    77 	if (parent.isValid())
       
    78 		return 0;
       
    79 	else
       
    80 		return 3;
       
    81 }
    46 }
    82 
    47 
    83 void HWNetWwwModel::updateList()
    48 void HWNetWwwModel::updateList()
    84 {
    49 {
    85 	QString request = QString("protocol_version=%1")
    50 	QString request = QString("protocol_version=%1")