Files
DbSketch/sketchlib/container/gradient.h
2018-09-16 06:05:23 +02:00

42 lines
1.1 KiB
C++

#pragma once
#include "basecontainer.h"
#include "sketchlib_global.h"
class QJsonObject;
class GradientStop;
class SKETCHLIB_EXPORT Gradient : public BaseContainer
{
Q_OBJECT
Q_PROPERTY(double elipseLength READ elipseLength CONSTANT)
Q_PROPERTY(QString from READ from CONSTANT)
Q_PROPERTY(double gradientType READ gradientType CONSTANT)
Q_PROPERTY(bool shouldSmoothenOpacity READ shouldSmoothenOpacity CONSTANT)
Q_PROPERTY(QList<GradientStop*> stops READ stops CONSTANT)
Q_PROPERTY(QString to READ to CONSTANT)
public:
Q_INVOKABLE explicit Gradient(QObject *parent = Q_NULLPTR);
double elipseLength() const;
const QString &from() const;
double gradientType() const;
bool shouldSmoothenOpacity() const;
const QList<GradientStop*> &stops() const;
const QString &to() const;
protected:
// BaseContainer interface
virtual bool parseProperty(const QString &key, const QJsonValue &value) Q_DECL_OVERRIDE;
private:
double m_elipseLength;
QString m_from;
double m_gradientType;
bool m_shouldSmoothenOpacity;
QList<GradientStop*> m_stops;
QString m_to;
};