diff -r c6bb4fdcc55f -r 78ba80b54bc4 treemodel.cpp --- a/treemodel.cpp Sat Aug 08 21:58:26 2009 +0000 +++ b/treemodel.cpp Tue Aug 18 12:39:07 2009 +0000 @@ -3,9 +3,10 @@ #include using namespace std; +#include "attributeitem.h" #include "branchitem.h" +#include "imageitem.h" #include "treeitem.h" -#include "imageitem.h" #include "treemodel.h" TreeModel::TreeModel(QObject *parent) @@ -51,13 +52,33 @@ return QVariant(); } +QModelIndex TreeModel::index (TreeItem* ti) +{ + if (!ti->parent()) + return QModelIndex(); + else + return createIndex (ti->row(),ti->column(),ti); +} + QModelIndex TreeModel::index(int row, int column, const QModelIndex &parent) const { TreeItem *parentItem; if (!parent.isValid()) + { //FIXME-1 parentItem = rootItem; + /* + cout << "TM::index() no parent?! xxx\n"; + cout << " row="<getHeadingStd()<parent(); + //cout << " pi="<getHeading().toStdString()<<" pi="<(index.internalPointer()); +// cout << " item="<row(),ti->column(),ti); -} -