diff options
author | Aleks Kissinger <aleks0@gmail.com> | 2018-10-06 15:49:50 +0200 |
---|---|---|
committer | Aleks Kissinger <aleks0@gmail.com> | 2018-10-06 15:49:50 +0200 |
commit | 6359b28b155355e0be67961cc21eccdbd2c61cc2 (patch) | |
tree | 94992fb08ffedf2b1481e97e7af34fbdfc076408 /src/data/nodestylelist.h | |
parent | e61fb864ec68a58abdb9cc9df047b4b75801c5e7 (diff) |
unified node and edge syles
Diffstat (limited to 'src/data/nodestylelist.h')
-rw-r--r-- | src/data/nodestylelist.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/data/nodestylelist.h b/src/data/nodestylelist.h new file mode 100644 index 0000000..03f7ed5 --- /dev/null +++ b/src/data/nodestylelist.h @@ -0,0 +1,40 @@ +#ifndef NODESTYLELIST_H +#define NODESTYLELIST_H + +#include "nodestyle.h" + +#include <QAbstractListModel> + +class NodeStyleList : public QAbstractListModel +{ + Q_OBJECT +public: + explicit NodeStyleList(QObject *parent = nullptr); + NodeStyle *style(QString name); + NodeStyle *style(int i); + int length() const; + void addStyle(NodeStyle *s); + void clear(); + QString tikz(); + + int numInCategory() const; + int nthInCategory(int n) const; + NodeStyle *styleInCategory(int n) const; + + QVariant data(const QModelIndex &index, int role) const override; + int rowCount(const QModelIndex &/*parent*/) const override; + + + QString category() const; + void setCategory(const QString &category); + +signals: + +public slots: + +private: + QVector<NodeStyle*> _styles; + QString _category; +}; + +#endif // NODESTYLELIST_H |