From eac7dee2d8ba86001afbc61c4e9d7baae7341cb8 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Tue, 10 Apr 2018 16:07:44 +0200 Subject: added edgestyles, but cant apply to nodes yet --- src/data/style.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/data/style.h (limited to 'src/data/style.h') diff --git a/src/data/style.h b/src/data/style.h new file mode 100644 index 0000000..9d58ebe --- /dev/null +++ b/src/data/style.h @@ -0,0 +1,36 @@ +#ifndef STYLE_H +#define STYLE_H + + +#include "graphelementdata.h" + +#include +#include +#include +#include +#include + +class Style +{ +public: + Style(); + Style(QString name, GraphElementData *data); + bool isNone(); + + // properties that both edges and nodes have + GraphElementData *data() const; + QString name() const; + QColor strokeColor() const; + int strokeThickness() const; + + // methods that are implemented differently for edges and nodes + virtual QPen pen() const; + virtual QPainterPath path() const = 0; + virtual QPainterPath palettePath() const = 0; + virtual QIcon icon() const = 0; +protected: + QString propertyWithDefault(QString prop, QString def) const; + QString _name; + GraphElementData *_data; +}; +#endif // STYLE_H -- cgit v1.2.3