How to achieve a blurred background
-
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? -
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);
-
@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.
-
@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.
@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. -
@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.
@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. -
@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.
@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
-
P Pl45m4 referenced this topic on