summaryrefslogtreecommitdiffstats
path: root/src/declarative/fx/qfxrect.h
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-05-29 01:32:39 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-05-29 01:32:39 (GMT)
commit9f95bd8f6e6ccf3575216285b29f2a42dcfd328d (patch)
tree4cc4a0be670927a3e613ab1b790ebd241b9dfcc8 /src/declarative/fx/qfxrect.h
parent3824fa64f8f8d24db34e3ce1c8d5c7d21cb624b7 (diff)
downloadQt-9f95bd8f6e6ccf3575216285b29f2a42dcfd328d.zip
Qt-9f95bd8f6e6ccf3575216285b29f2a42dcfd328d.tar.gz
Qt-9f95bd8f6e6ccf3575216285b29f2a42dcfd328d.tar.bz2
Update in reaction to GradientStops changing.
Diffstat (limited to 'src/declarative/fx/qfxrect.h')
-rw-r--r--src/declarative/fx/qfxrect.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/declarative/fx/qfxrect.h b/src/declarative/fx/qfxrect.h
index 864b1cd..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;
@@ -116,9 +119,16 @@ public:
const QGradient *gradient() const;
+Q_SIGNALS:
+ void updated();
+
+private:
+ void doUpdate();
+
private:
QList<QFxGradientStop *> m_stops;
mutable QGradient *m_gradient;
+ friend class QFxGradientStop;
};
QML_DECLARE_TYPE(QFxGradient)