QTfrontend/netserverslist.cpp
changeset 668 0d7683a66d61
parent 665 5c7bfc8bac6a
child 883 07a568ba44e0
--- a/QTfrontend/netserverslist.cpp	Sat Dec 15 20:08:08 2007 +0000
+++ b/QTfrontend/netserverslist.cpp	Sat Dec 15 20:28:58 2007 +0000
@@ -31,3 +31,38 @@
 {
 
 }
+
+QVariant HWNetServersModel::headerData(int section,
+            Qt::Orientation orientation, int role) const
+{
+	if (role != Qt::DisplayRole)
+		return QVariant();
+
+	if (orientation == Qt::Horizontal)
+	{
+		switch (section)
+		{
+			case 0: return tr("Title");
+			case 1: return tr("IP");
+			case 2: return tr("Port");
+			default: return QVariant();
+		}
+	} else
+		return QString("%1").arg(section + 1);
+}
+
+int HWNetServersModel::rowCount(const QModelIndex &parent) const
+{
+	if (parent.isValid())
+		return 0;
+	else
+		return games.size();
+}
+
+int HWNetServersModel::columnCount(const QModelIndex & parent) const
+{
+	if (parent.isValid())
+		return 0;
+	else
+		return 3;
+}