使用PropertyChanges更改半径时QML GaussianBlur崩溃

时间:2017-02-08 18:28:39

标签: qt crash qml qtquick2 blur

当你点击任何地方时,这个测试用程序会崩溃,而且由于它的微小变化使它停止崩溃,这似乎是一个Qt错误,但我发布在这里以防万一我做了一些巧妙的错误

如果不停止崩溃,我就无法做到这一点。

main.qml

import QtQuick 2.5
import QtQuick.Window 2.2

Window {
    visible: true
    width: 800
    height: 500

    MyItem {
        anchors.fill: parent
    }
}

MyItem.qml

import QtQuick 2.0
import QtGraphicalEffects 1.0

Item {
    id: root

    property bool inFooState: false

    GaussianBlur {
        id: gauss
        source: gaussSource
        anchors.fill: gaussSource

        radius: 9
        samples: 16
    }

    Rectangle {
        id: gaussSource
        color: "red"
        layer.enabled: true
        anchors.fill: parent
    }

    MouseArea {
        anchors.fill: parent

        onPressed: {
            inFooState = true;
        }
    }

    states: [
        State {
            name: "fooState"; when: inFooState
            PropertyChanges {
                target: gauss
                radius: 8 // changing this to 7 fixes it.
            }
        }
    ]
}

注意:我也创建了Qt bugreport

0 个答案:

没有答案