From c76bb1dcda7b0339d9de427d155b593b3779bea7 Mon Sep 17 00:00:00 2001 From: Andreas Aardal Hanssen Date: Fri, 2 Oct 2009 09:10:05 +0200 Subject: Enable QGraphicsBloomEffect in QML. Also add this to the effect example. Reviewed-by: Aaron Kennedy --- examples/declarative/effects/test.qml | 18 +++++++++++++++++- src/declarative/fx/qfxitem.cpp | 4 ++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/examples/declarative/effects/test.qml b/examples/declarative/effects/test.qml index 4cc8746..ad03ef9 100644 --- a/examples/declarative/effects/test.qml +++ b/examples/declarative/effects/test.qml @@ -66,8 +66,24 @@ Rectangle { } + Image { + source: "pic.jpg" + + x: 400 + y: 300 + effect: Bloom { + blurRadius: 3 + brightness: 128 + strength: NumberAnimation { id: BLS; from: 0; to: 1; duration: 200; repeat: true; } + } + + MouseRegion { anchors.fill: parent; onClicked: BLS.running = !BLS.running } + + Text { color: "white"; text: "Bloom" } + } + Text { - x: 400; y: 300 + x: 100; y: 250 text: "Clicking Blur, Pixelize or DropShadow will \ntoggle animation." color: "black" } diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp index 7f4e6b1..4d31aaa 100644 --- a/src/declarative/fx/qfxitem.cpp +++ b/src/declarative/fx/qfxitem.cpp @@ -96,6 +96,10 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,DropShadow,QGraphicsDropShadowEf QML_DECLARE_TYPE(QGraphicsOpacityEffect) QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Opacity,QGraphicsOpacityEffect) + +QML_DECLARE_TYPE(QGraphicsBloomEffect) +QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Bloom,QGraphicsBloomEffect) + /*! \qmlclass Transform \brief A transformation. -- cgit v0.12