How to replace the effect property of the Text element [SOLVED]



  • I noticed that in previous version of QML, it was possible for example to blur some text such as

    @
    Rectangle {
    width: 400
    height: 200
    color: "lightblue"

    Text {
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.verticalCenter: parent.verticalCenter
        text: "Qt Quick"; font.pixelSize: 64
        effect: Blur { blurRadius: 5 }
    }
    

    }
    @

    I can't find the blur property anymore. How can we achieve the same effect?

    Thanks



  • hi
    first of all you should import: import QtGraphicalEffects 1.0
    http://qt-project.org/doc/qt-5/graphicaleffects.html
    and then use FastBlur Type:

    @import QtQuick 2.0
    import QtGraphicalEffects 1.0

    Item {
    width: 300
    height: 300

    Text {
        id: text
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.verticalCenter: parent.verticalCenter
        text: "Qt Quick"; font.pixelSize: 64
    }
    
    FastBlur {
        anchors.fill: text
        source: text
        radius: 32
    }
    

    }@



  • So I guess what used to be the effect method inside text/image..etc, is now its own Element.

    Thanks a lot madoodia.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.