Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[Qt Design Studio] Does QDS support graphical effect “ThresholdMask”?



  • hi,
    I'm a designer. I have read the document and found that there is a QML type "ThresholdMask" which interests me.
    (doc link:https://doc.qt.io/qt-5/qml-qtgraphicaleffects-thresholdmask.html)

    But when I try it in Qt Designer Studio, it doesn't work.

    version: QDS v1.2 community, Qt 5.12

    code bellow:

    import QtQuick 2.0
    import QtGraphicalEffects 1.0
    
    Item {
        id: root
    
        default property alias contentStack: stack.children
    
        implicitWidth: Math.max(32, stack.implicitWidth)
        implicitHeight: Math.max(32, stack.implicitHeight)
    
        Item {
            z: -1
            id: stack
            implicitWidth: blend.source.width + blend.source.x
            implicitHeight: blend.source.height + blend.source.y
    
            visible: false
        }
    
        ThresholdMask  {
            id: blend
            anchors.fill: parent
            source: root.background
            maskSource: root.foreground
    
        }
    
        property Item background
        property Item foreground
    
        property Item foo: Item {}
    
        Component.onCompleted: {
            root.background = stack.children[0]
            root.foreground = stack.children[1]
        }
    }
    
    

    QDS screenshot:
    13f811a7-b719-4067-bd1a-fd3d4a129dbc-image.png

    Is QDS supports this QML type?
    Thanks for your help.



  • Yeah, it should work (as in it works for me). But i'm running the latest 1.4 release, perhaps try updating to that one?

    thresholdMask.png



  • @BrookCronin thank you, Bro! it worked! QDS v1.4 adds more effect.

    QDS v1.4
    1a57c63f-221a-4a13-a904-af1f3436b7db-image.png

    QDS v1.2
    204bc075-713d-4307-8b6c-1ef8386294c6-image.png


Log in to reply