treemodel.h
author insilmaril
Tue, 20 Jan 2009 15:23:16 +0000
changeset 735 84ae10f6e3a3
parent 729 7ddbe3fa34a1
child 740 6dc0a20031f7
permissions -rw-r--r--
More work on removing Selection class
     1 #ifndef TREEMODEL_H
     2 #define TREEMODEL_H
     3 
     4 #include <QAbstractItemModel>
     5 #include <QModelIndex>
     6 #include <QVariant>
     7 
     8 
     9 class TreeItem;
    10 class LinkableMapObj;
    11 
    12 class TreeModel : public QAbstractItemModel
    13 {
    14     Q_OBJECT
    15 
    16 public:
    17     TreeModel(QObject *parent = 0);
    18     ~TreeModel();
    19 
    20     QVariant data(const QModelIndex &index, int role) const;
    21     Qt::ItemFlags flags(const QModelIndex &index) const;
    22     QVariant headerData(int section, Qt::Orientation orientation,
    23                         int role = Qt::DisplayRole) const;
    24     QModelIndex index(int row, int column,
    25                       const QModelIndex &parent = QModelIndex()) const;
    26     QModelIndex parent(const QModelIndex &index) const;
    27     int rowCount(const QModelIndex &parent = QModelIndex()) const;
    28     int columnCount(const QModelIndex &parent = QModelIndex()) const;
    29 
    30 	TreeItem *first();
    31 	TreeItem *next();
    32 
    33 	bool removeRows ( int row, int count, 
    34 				const QModelIndex & parent = QModelIndex() ); 
    35 
    36 	QModelIndex index (TreeItem* ti);
    37 
    38 protected:
    39     TreeItem *rootItem;
    40 	static TreeItem* itFirst;
    41 	static TreeItem* itCur;
    42 };
    43 
    44 #endif