From 738ecbd5fad2b46836bfd6a94aeebf165ae2bbca Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Thu, 4 Jan 2018 16:00:52 +0100 Subject: relocated source code to the root --- src/data/graphelementdata.h | 66 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 src/data/graphelementdata.h (limited to 'src/data/graphelementdata.h') diff --git a/src/data/graphelementdata.h b/src/data/graphelementdata.h new file mode 100644 index 0000000..1139a00 --- /dev/null +++ b/src/data/graphelementdata.h @@ -0,0 +1,66 @@ +#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; + + void operator <<(GraphElementProperty p); + void add(GraphElementProperty p); + + QString tikz(); + bool isEmpty(); +signals: + +public slots: + +private: + QVector _properties; + GraphElementProperty *root; +}; + +#endif // GRAPHELEMENTDATA_H -- cgit v1.2.3