diff options
author | Aleks Kissinger <aleks0@gmail.com> | 2018-10-06 19:55:55 +0200 |
---|---|---|
committer | Aleks Kissinger <aleks0@gmail.com> | 2018-10-06 19:55:55 +0200 |
commit | 263678a6d295d492351698db50a57c9db3bfe8ae (patch) | |
tree | f28e3e9eb9896a99a9587f265db3350fb6b5cfe6 /src/data/stylelist.h | |
parent | c0b8dea3d3b93fd4b87e5311b6c6422a7ccdb723 (diff) |
switched to custom style model
Diffstat (limited to 'src/data/stylelist.h')
-rw-r--r-- | src/data/stylelist.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/data/stylelist.h b/src/data/stylelist.h new file mode 100644 index 0000000..f698761 --- /dev/null +++ b/src/data/stylelist.h @@ -0,0 +1,41 @@ +#ifndef NODESTYLELIST_H +#define NODESTYLELIST_H + +#include "style.h" + +#include <QAbstractListModel> + +class StyleList : public QAbstractListModel +{ + Q_OBJECT +public: + explicit StyleList(bool edgeStyles = false, QObject *parent = nullptr); + Style *style(QString name); + Style *style(int i); + int length() const; + void addStyle(Style *s); + void clear(); + QString tikz(); + + int numInCategory() const; + int nthInCategory(int n) const; + Style *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<Style*> _styles; + QString _category; + bool _edgeStyles; +}; + +#endif // NODESTYLELIST_H |