treemodel.h
author insilmaril
Wed Mar 10 15:36:19 2010 +0000 (2010-03-10)
changeset 834 0fad394bc330
parent 793 cac93797c580
child 847 43268373032d
permissions -rw-r--r--
Minor fixes
     1 #ifndef TREEMODEL_H
     2 #define TREEMODEL_H
     3 
     4 #include <QAbstractItemModel>
     5 #include <QModelIndex>
     6 #include <QVariant>
     7 
     8 
     9 class BranchItem;
    10 class TreeItem;
    11 class LinkableMapObj;
    12 
    13 class TreeModel : public QAbstractItemModel
    14 {
    15     Q_OBJECT
    16 
    17 public:
    18     TreeModel(QObject *parent = 0);
    19     ~TreeModel();
    20 
    21     QVariant data(const QModelIndex &index, int role) const;
    22     Qt::ItemFlags flags(const QModelIndex &index) const;
    23     QVariant headerData(int section, Qt::Orientation orientation,
    24                         int role = Qt::DisplayRole) const;
    25 	QModelIndex index (TreeItem* ti);
    26     QModelIndex index(int row, int column,
    27                       const QModelIndex &parent = QModelIndex()) const;
    28     QModelIndex parent(const QModelIndex &index) const;
    29     int rowCount(const QModelIndex &parent = QModelIndex()) const;
    30     int columnCount(const QModelIndex &parent = QModelIndex()) const;
    31 
    32 	BranchItem* nextBranch (BranchItem* &current, BranchItem* &previous, bool deepLevelsFirst=true, BranchItem* start=NULL);
    33 
    34 	bool removeRows ( int row, int count, 
    35 				const QModelIndex & parent = QModelIndex() ); 
    36 
    37 	TreeItem* getItem (const QModelIndex &index) const;
    38 	BranchItem* getRootItem();
    39 
    40 
    41 protected:
    42     BranchItem *rootItem;
    43 };
    44 
    45 #endif