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. Qt QML - FastBlur with rounded corners rectange and background image
Forum Updated to NodeBB v4.3 + New Features

Qt QML - FastBlur with rounded corners rectange and background image

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 3.3k Views 1 Watching
  • 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.
  • M Offline
    M Offline
    marcin100
    wrote on last edited by
    #1

    Hello,

    Does anyone know how to make the FastBlur fit the rectangle with rounded corners? I tried many things and failed.

    I tried MaskedBlur with same negative results.

    FastBlur with OpacityMask would work if the mask could be inversed. What I did here is I blurred the whole background and then applied the OpacityMask to the rectangle with round corners. The mask fits nicely with rounded corners but it leaves blur everywhere except the rectangle.
    I am looking for the exact opposite effect. Any ideas?

    Second question: FastBlur - source: ??
    Assume there is a background image (id: background) filling whole screen and a small rectangle in the middle. I noticed that if I set the source: background for FastBlur then the whole blurred backround image is scalled and fitted into the rectangle.
    What is the proper way of having a blured rectangle which could be animated and moved on top of a background image?

    @ Image {
    id: background
    width: parent.width
    height: parent.height
    anchors.rightMargin: 0
    anchors.bottomMargin: 0
    anchors.leftMargin: 0
    anchors.topMargin: 0
    source: "img/Dark_blue_800x480.jpg"
    anchors.fill: parent
    }

    FastBlur
    {
        anchors.fill: button1
        source: background
        radius: 20
    }
    
    Rectangle
    {
        id: button1
        anchors.centerIn: parent
        width: 100
        height: 50
    }
    

    @

    1 Reply Last reply
    0
    • M Offline
      M Offline
      marcin100
      wrote on last edited by
      #2

      Hmmm. Is this really not possible? Qt Quick limitation maybe?

      1 Reply Last reply
      0
      • GianlucaG Offline
        GianlucaG Offline
        Gianluca
        wrote on last edited by
        #3

        Did you try to set source to Rectangle ?
        @

        FastBlur {
        anchors.fill: button1
        source: button1
        radius: 20
        }

        Rectangle {
        id: button1
        visible: false /* IMPORTANT !! The source has to be invisible */
        anchors.centerIn: parent
        width: 100
        height: 50
        }
        @

        Answer to FastBlur source: source can be any visual Qt Quick Item, so it can be a Rectangle. Do not limit yourself to images :-)

        1 Reply Last reply
        0
        • M Offline
          M Offline
          marcin100
          wrote on last edited by
          #4

          Yes I tried it, but slightly different. The button1 has to be visible because it also has text which is not blurred, so I created a child rectangle which filled button1 and set this one to invisible and made it a source for FastBlur.
          But nothing was blurred. Maybe because the rectangle I created was two levels a above the background.
          I will do more experiments and report back. 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