From e2729afb2fc7234a8b307f030907725f97ac8786 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Sat, 2 May 2009 02:42:13 -0400 Subject: Use multiple columns --- sigmodr/tree/TreeModel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sigmodr/tree/TreeModel.cpp') diff --git a/sigmodr/tree/TreeModel.cpp b/sigmodr/tree/TreeModel.cpp index 801fbdb7..1cfbd6ae 100644 --- a/sigmodr/tree/TreeModel.cpp +++ b/sigmodr/tree/TreeModel.cpp @@ -42,9 +42,9 @@ QModelIndex TreeModel::index(const int row, const int column, const QModelIndex& if (!parent.isValid()) return QModelIndex(); TreeItem* item = static_cast(parent.internalPointer()); - if (column || (row < 0) || (item->childCount() <= row)) + if ((column < 0) || (4 <= column) || (row < 0) || (item->childCount() <= row)) return QModelIndex(); - return createIndex(row, 0, item->childAt(row)); + return createIndex(row, column, item->childAt(row)); } QModelIndex TreeModel::parent(const QModelIndex& child) const @@ -72,7 +72,7 @@ int TreeModel::rowCount(const QModelIndex& parent) const int TreeModel::columnCount(const QModelIndex& parent) const { - return 1; + return 4; } Qt::ItemFlags TreeModel::flags(const QModelIndex& index) const -- cgit