treeitem.h
author insilmaril
Tue, 20 Jan 2009 15:23:16 +0000
changeset 735 84ae10f6e3a3
parent 727 96402b172173
child 738 716a777c1c98
permissions -rw-r--r--
More work on removing Selection class
     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,Image};
    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