QML模糊效果

时间:2017-03-02 19:55:51

标签: qml

我希望整个屏幕必须在中心旁边模糊。 我该怎么做?

Rectangle
{
    x: 100
    y: 100
    height: 250
    width: 250
    color: "red"
}

//我希望这个方块没有模糊

SET @sql = N'
INSERT INTO ' + @DBNAME + '(....'

2 个答案:

答案 0 :(得分:0)

import QtQuick 2.5
import QtQuick.Window 2.2
import QtGraphicalEffects 1.0

Window 
{
    visible: true
    width: 640
    height: 480
    title: qsTr("Hello World")

    Image
    {
        id:img
        source:"qrc:/Tulips.jpg"
        anchors.fill: parent
        visible: false
    }

    FastBlur
    {
        anchors.fill: parent
        source: img
        radius: 100
    }

    Rectangle
    {
        id:rect
        height: 250
        width: 250
        anchors.centerIn: parent
        color:"red"
    }
}

答案 1 :(得分:0)

使用z值?

Window {
    Rectangle {
        z: 0
        id: blurred_background
        anchors.fill: parent
    }
    FastBlue {
        z: 1
        anchors.fill: parent
        source: blurred_background
    }
    Rectangle {
        z: 2
        id: nonblurred_foreground
        height: 250
        width: 250
    }
}

用您想要的任何项目替换矩形! 并确保不要忽略blur cannot blur a parent of itself as source

文档中的警告
相关问题