Skip to content
  • 0 Votes
    1 Posts
    806 Views
    No one has replied
  • 0 Votes
    1 Posts
    585 Views
    No one has replied
  • Blur image (dynamic source)

    Unsolved QML and Qt Quick
    3
    0 Votes
    3 Posts
    857 Views
    MarkkyboyM

    Despite this question being 4 years old, I'll answer it anyway.

    @helenebro - your formatting is likely causing your issue as you have nested 'FastBlur' inside 'Image' preventing the effect from showing. After formatting and a little adjustment to your code, I came up with the following. I hope I understand you correctly. When I first tried your code, I also got a black 'rectangle'.

    import QtQuick 2.12 import QtQuick.Window 2.12 import QtGraphicalEffects 1.0 Window { visible: true width: 640 height: 580 title: qsTr("Image_bug") Item { width: 200 height: 300 Image { id: image_bug width: 400; height: 500 source: "image_bug.jpg" } FastBlur{ id: blur anchors.fill: image_bug source: image_bug radius: 50 } } }

    image_bug_blurred.JPG

    @Sam_George - does this help you at all?, please let me know either way, thanks.

  • 0 Votes
    5 Posts
    7k Views
    M

    @LuGRU Very cool! I finally was able to pull this off with my promoted widget, whereas other techniques didn't work unless I switched the effect to width/height animation.

    // w is my widget QGraphicsOpacityEffect *eff = new QGraphicsOpacityEffect(this); w->setGraphicsEffect(eff); QPropertyAnimation *a = new QPropertyAnimation(eff,"opacity"); a->setDuration(300); a->setStartValue(0); a->setEndValue(1); a->start(QPropertyAnimation::DeleteWhenStopped);