treeitem.h
author insilmaril
Mon, 06 Oct 2008 11:10:20 +0000
changeset 726 7f43b93242aa
parent 725 7ea31701156e
child 727 96402b172173
permissions -rw-r--r--
Various fixes, also from 1.12. branch
     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     void appendChild(TreeItem *child);
    17 
    18     TreeItem *child(int row);
    19     int childCount() const;
    20     int columnCount() const;
    21     QVariant data(int column) const;
    22 	void setHeading (const QString s);
    23 	QString getHeading();
    24 	void setType (const Type t);
    25 	Type getType ();
    26 	QString getTypeName ();
    27 	
    28     int row() const;
    29 	int column() const;
    30     TreeItem *parent();
    31 
    32 	// Relation to map objects in graphicsscene
    33 	LinkableMapObj* getLMO();
    34 	void setLMO (LinkableMapObj*);
    35 
    36 private:
    37     QList<TreeItem*> childItems;
    38     QList<QVariant> itemData;
    39     TreeItem *parentItem;
    40  
    41 	Type type;
    42 	LinkableMapObj *lmo;
    43 };
    44 
    45 #endif