Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to blur everything behind the Item
Forum Updated to NodeBB v4.3 + New Features

How to blur everything behind the Item

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 237 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    yegender
    wrote on last edited by
    #1

    I am making a window manager like thing. Behind the active window everything is just dynamic they change their order and stuff and much going on. FastBlur can only blur the source Item. But here there are too many Source Items. How can I add blur behind every item. Here is my code :

    import QtQuick 2.15
    import QtQuick.Window 2.15
    import QtQuick.Controls 2.15
    import QtQuick.Layouts 1.15
    import QtGraphicalEffects 1.15
    import QtWayland.Compositor 1.15
    
    Item {
        WaylandCompositor {
            id: waylandCompositor
            WaylandOutput {
                id: output
                compositor: waylandCompositor
                property ListModel shellSurfaces: ListModel {}
                function handleShellSurface(shellSurface) {
                    shellSurfaces.append({
                                             shellSurface: shellSurface
                                         })
                }
                sizeFollowsWindow: true
                window: Window {
                    width: 1024
                    height: 760
                    visible: true
                    id:window
                    Image{
                        id:wallpaper
                        anchors.fill: parent
                        fillMode: Image.PreserveAspectCrop
                        source:"file:///home/yegender/Pictures/ghost.png"
                    }
                    Repeater {
                        model: output.shellSurfaces
                        id:rept
                        Item{
                            anchors.fill: parent
                            ShaderEffectSource{
                                x:20
                                y:20
                                width:480
                                height:640
                                sourceRect: Qt.rect(x,y,width,height)
                                id:be
                                sourceItem:window
                            }
                            FastBlur{
                                source:be
                                radius:50
                                anchors.fill: be
                                Rectangle{
                                    color:"white"
                                    x:0
                                    y:0
                                    width:parent.width
                                    height:30
                                    Label{
                                        x:10
                                        y:(parent.height/2)-(height/2)
                                        text:modelData.toplevel.title
                                    }
                                    DragHandler{
                                        target:be
                                    }
                                }
                                ShellSurfaceItem {
                                    x:0
                                    y:30
                                    width:parent.width
                                    height: parent.height-30
                                    onWidthChanged: modelData.toplevel.sendConfigure(Qt.size(width,height),XdgSurface)
                                    onHeightChanged: modelData.toplevel.sendConfigure(Qt.size(width,height),XdgSurface)
                                    shellSurface: modelData
                                    onSurfaceDestroyed: output.shellSurfaces.remove(index)
                                }
                            }
    
                        }
                    }
                }
            }
            XdgShell {
                onToplevelCreated: {
                    output.handleShellSurface(xdgSurface)
                }
            }
            XdgDecorationManagerV1 {
                preferredMode: XdgToplevel.ServerSideDecoration
            }
        }
    }
    
    

    It's outputing like this:
    4398a967-d64b-4d47-9d4a-7504b3adebe1-image.png

    But I want blurring like this:
    7e6e8987-9275-4623-a642-27877931dd18-image.png

    Thanks

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved