diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-05-29 04:44:21 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-05-29 04:44:21 (GMT) |
commit | 80518af09b464c88dfd419fa6087cffc1dc914b5 (patch) | |
tree | 5b610a298548aaa26e7b3ee56d36844d3f41a53d /src/declarative/fx/qfxrect.h | |
parent | 5b542cc9faf016c9071f41fa85ab071d05b0f26a (diff) | |
parent | 9f95bd8f6e6ccf3575216285b29f2a42dcfd328d (diff) | |
download | Qt-80518af09b464c88dfd419fa6087cffc1dc914b5.zip Qt-80518af09b464c88dfd419fa6087cffc1dc914b5.tar.gz Qt-80518af09b464c88dfd419fa6087cffc1dc914b5.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/fx/qfxrect.h')
-rw-r--r-- | src/declarative/fx/qfxrect.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/declarative/fx/qfxrect.h b/src/declarative/fx/qfxrect.h index 2c59914..c279a1c 100644 --- a/src/declarative/fx/qfxrect.h +++ b/src/declarative/fx/qfxrect.h @@ -90,10 +90,13 @@ public: QFxGradientStop(QObject *parent=0) : QObject(parent) {} qreal position() const { return m_position; } - void setPosition(qreal position) { m_position = position; } + void setPosition(qreal position) { m_position = position; updateGradient(); } QColor color() const { return m_color; } - void setColor(const QColor &color) { m_color = color; } + void setColor(const QColor &color) { m_color = color; updateGradient(); } + +private: + void updateGradient(); private: qreal m_position; @@ -109,16 +112,23 @@ class Q_DECLARATIVE_EXPORT QFxGradient : public QObject Q_CLASSINFO("DefaultProperty", "stops") public: - QFxGradient(QObject *parent=0) : QObject(parent), m_gradient(0), m_created(false) {} + QFxGradient(QObject *parent=0) : QObject(parent), m_gradient(0) {} + ~QFxGradient() { delete m_gradient; } QList<QFxGradientStop *> *stops() { return &m_stops; } const QGradient *gradient() const; +Q_SIGNALS: + void updated(); + +private: + void doUpdate(); + private: QList<QFxGradientStop *> m_stops; mutable QGradient *m_gradient; - mutable bool m_created; + friend class QFxGradientStop; }; QML_DECLARE_TYPE(QFxGradient) |