treeitem.h
author insilmaril
Mon Dec 08 16:57:33 2008 +0000 (2008-12-08)
changeset 729 7ddbe3fa34a1
parent 726 7f43b93242aa
child 735 84ae10f6e3a3
permissions -rw-r--r--
More fixes for selections
     1 #ifndef TREEITEM_H
     2 #define TREEITEM_H
     3 
     4 #include <QList>
     5 #include <QVariant>
     6 
     7 class LinkableMapObj;
     8 
     9 class TreeItem
    10 {
    11 public:
    12 	enum Type {Undefined,MapCenter,Branch};
    13     TreeItem(const QList<QVariant> &data, TreeItem *parent = 0);
    14     ~TreeItem();
    15 
    16 	// General housekeeping
    17     void appendChild (TreeItem *child);
    18 	void removeChild (int row);
    19 
    20     TreeItem *child(int row);
    21     int childCount() const;
    22     int columnCount() const;
    23 
    24     int row() const;
    25 	int column() const;
    26     TreeItem *parent();
    27 
    28 	// Accessing data
    29     QVariant data(int column) const;
    30 	void setHeading (const QString s);
    31 	QString getHeading();
    32 	void setType (const Type t);
    33 	Type getType ();
    34 	QString getTypeName ();
    35 	
    36 	// Relation to map objects in graphicsscene
    37 	LinkableMapObj* getLMO();
    38 	void setLMO (LinkableMapObj*);
    39 
    40 private:
    41     QList<TreeItem*> childItems;
    42     QList<QVariant> itemData;
    43     TreeItem *parentItem;
    44  
    45 	Type type;
    46 	LinkableMapObj *lmo;
    47 };
    48 
    49 #endif