treemodel.h
author insilmaril
Wed, 04 Feb 2009 16:33:16 +0000
changeset 740 6dc0a20031f7
parent 729 7ddbe3fa34a1
child 741 1b4d1ea6ea8c
permissions -rw-r--r--
started to rewrite first(), next()
     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 QModelIndex ixCur;
    41 	static TreeItem *itStartParent;
    42 };
    43 
    44 #endif