1 #ifndef ATTRIBUTEITEM_H
2 #define ATTRIBUTEITEM_H
7 #include "branchitem.h"
9 /*! \brief A key and a value
10 The data itself is stored in Attribute Definitions (AttributeDef).
11 A list of these tables AttributeTable is maintained for every MapEditor.
13 class AttributeItem : public BranchItem {
16 Undefined, //!< Undefined type
18 DateTime, //!< DateTime
22 AttributeItem(TreeItem *parent = nullptr);
23 AttributeItem(const QString &k, const QString &v, TreeItem *parent = nullptr);
24 virtual ~AttributeItem();
25 void copy(AttributeItem *other);
26 void set(const QString &k, const QString &v);
27 void get(QString &k, QString &v, Type &t);
28 void setKey(const QString &k);
30 void setValue(const QString &v);
31 void setValue(const qlonglong &n);
32 void setValue(const QDateTime &dt);
34 QDateTime getValueDateTime();
35 using BranchItem::setType;
36 virtual void setAttributeType(const Type &t);
37 AttributeItem::Type getAttributeType();
38 QString getAttributeTypeString();
39 void setInternal(bool b);
45 bool internal; //!< Internal attributes cannot be edited by user