From b4f6b3997ba1d1355a42e6d2cd90e7715a9f9114 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Fri, 20 Jan 2017 11:25:28 +0100 Subject: directory structure --- tikzit/src/data/graphelementdata.h | 61 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 tikzit/src/data/graphelementdata.h (limited to 'tikzit/src/data/graphelementdata.h') diff --git a/tikzit/src/data/graphelementdata.h b/tikzit/src/data/graphelementdata.h new file mode 100644 index 0000000..fee65e7 --- /dev/null +++ b/tikzit/src/data/graphelementdata.h @@ -0,0 +1,61 @@ +#ifndef GRAPHELEMENTDATA_H +#define GRAPHELEMENTDATA_H + +#include "graphelementproperty.h" + +#include +#include +#include +#include +#include + +class GraphElementData : public QAbstractItemModel +{ + Q_OBJECT +public: + explicit GraphElementData(QObject *parent = 0); + ~GraphElementData(); + void setProperty(QString key, QString value); + void unsetProperty(QString key); + void setAtom(QString atom); + void unsetAtom(QString atom); + QString property(QString key); + bool atom(QString atom); + + QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE; + QVariant headerData(int section, Qt::Orientation orientation, + int role = Qt::DisplayRole) const Q_DECL_OVERRIDE; + + QModelIndex index(int row, int column, + const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + QModelIndex parent(const QModelIndex &index) const Q_DECL_OVERRIDE; + + int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; + + Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE; + +// bool setData(const QModelIndex &index, const QVariant &value, +// int role = Qt::EditRole) Q_DECL_OVERRIDE; +// bool setHeaderData(int section, Qt::Orientation orientation, +// const QVariant &value, int role = Qt::EditRole) Q_DECL_OVERRIDE; + +// bool insertColumns(int position, int columns, +// const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE; +// bool removeColumns(int position, int columns, +// const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE; +// bool insertRows(int position, int rows, +// const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE; +// bool removeRows(int position, int rows, +// const QModelIndex &parent = QModelIndex()) Q_DECL_OVERRIDE; + +signals: + +public slots: + +private: + QVector _properties; + GraphElementProperty *root; +}; + +#endif // GRAPHELEMENTDATA_H -- cgit v1.2.3