Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to achieve a blurred background
Forum Updated to NodeBB v4.3 + New Features

How to achieve a blurred background

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 5 Posters 7.2k Views 2 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.
  • A Offline
    A Offline
    adutzu89
    wrote on last edited by
    #1

    Hello,
    I want to make a blurred background using Qt(preferable using QML) but I can't seem to figure it out how to do it.
    I can make a blurred background if the window is in 1 place, using quick image provider, where I grab the screen make an image, give to Image qml item and blur it using fastblur.
    But I doubt this is feasible when doing it for a moving window.
    Any ideeas?

    1 Reply Last reply
    0
    • qwasder85Q Offline
      qwasder85Q Offline
      qwasder85
      wrote on last edited by qwasder85
      #2

      You can blur an entire QWidget (even a QMainWindow) without QML:

          QGraphicsBlurEffect* p_blur = new QGraphicsBlurEffect;
          p_blur->setBlurRadius(3);
          p_blur->setBlurHints(QGraphicsBlurEffect::QualityHint);
      
          m_p_my_widget->setGraphicsEffect(p_blur);
      
      1 Reply Last reply
      0
      • Chris KawaC Offline
        Chris KawaC Offline
        Chris Kawa
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @qwasder85 I think the OP means blurring what's behind the window, not the widget itself.

        @adutzu89 Unfortunately this is not something you can do with Qt efficiently enough for a moving window, as this is highly platform specific effect. On Windows for example this is easily achieved with acrylic brush. Unfortunately this is XAML specific and to achieve the same with C++ and Qt you'd have to dig deep into DirectComposition API which essentially gives you direct access to the window's DirectX framebuffer where you can apply the blur effect efficiently.

        A K S 3 Replies Last reply
        6
        • Chris KawaC Chris Kawa

          @qwasder85 I think the OP means blurring what's behind the window, not the widget itself.

          @adutzu89 Unfortunately this is not something you can do with Qt efficiently enough for a moving window, as this is highly platform specific effect. On Windows for example this is easily achieved with acrylic brush. Unfortunately this is XAML specific and to achieve the same with C++ and Qt you'd have to dig deep into DirectComposition API which essentially gives you direct access to the window's DirectX framebuffer where you can apply the blur effect efficiently.

          A Offline
          A Offline
          adutzu89
          wrote on last edited by
          #4

          @qwasder85 indeed, I want to blur the background of the main window, not a widget.
          @Chris-Kawa, sorry for answering slow will look more into what's specific for Linux as my target is Linux. Thanks for answering.

          1 Reply Last reply
          0
          • Chris KawaC Chris Kawa

            @qwasder85 I think the OP means blurring what's behind the window, not the widget itself.

            @adutzu89 Unfortunately this is not something you can do with Qt efficiently enough for a moving window, as this is highly platform specific effect. On Windows for example this is easily achieved with acrylic brush. Unfortunately this is XAML specific and to achieve the same with C++ and Qt you'd have to dig deep into DirectComposition API which essentially gives you direct access to the window's DirectX framebuffer where you can apply the blur effect efficiently.

            K Offline
            K Offline
            kussg
            wrote on last edited by
            #5

            @Chris-Kawa I would be interested if future Qt release has a way to consider this feature.
            At moment for the current approach with DirectComposition, any pointer (or tutorial) would be appreciated. Thanks.

            1 Reply Last reply
            0
            • Chris KawaC Chris Kawa

              @qwasder85 I think the OP means blurring what's behind the window, not the widget itself.

              @adutzu89 Unfortunately this is not something you can do with Qt efficiently enough for a moving window, as this is highly platform specific effect. On Windows for example this is easily achieved with acrylic brush. Unfortunately this is XAML specific and to achieve the same with C++ and Qt you'd have to dig deep into DirectComposition API which essentially gives you direct access to the window's DirectX framebuffer where you can apply the blur effect efficiently.

              S Offline
              S Offline
              simopdev
              wrote on last edited by
              #6

              @Chris-Kawa Hi, can you post a small example to get this feature please? Or can you tell me where I should go to look for more about that? Thank you

              1 Reply Last reply
              0
              • Pl45m4P Pl45m4 referenced this topic on

              • Login

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