0
votes

I've been testing GUI possibilities using QtQuick and QML, but I've been having trouble finding information on applying GLSL shader effects to the Window itself. For example, let's say I want to make a fullscreen application that simply blurs everything behind the window; as you move the application window around your desktop, everything behind the window would be affected by the shaders, and if you maximize the app the entire screen would be affected.

In the official QtQuick5.2 documentation, they mention applying a shader effect to an Image element. In order to do so, they make a variant and connect it to the Image using the id. I've tried referring to the 'id' property of my 'Window' QML element, but it doesn't work (results in a black window as the shader fails to process correctly). There is also the QtGraphicalEffects module, which has some very nice effects built into it, but I haven't had much luck with applying those effects to the window either.

So, with QtQuick2.2 and QML, is there anyway to 'capture' the pixels behind the window and process them using a GLSL shader and/or QML Graphical Effects property?

1

1 Answers

1
votes

Interesting task, if you want to actually manipulate the pixels on the screen that do not appear to be a part of your program window but rather are part of the desktop behind the window? The best way I can think of for Qt to "capture" the pixels that seem outside its main window is to actually make them part of the Qt window by making part of the window transparent. This will probably require some trial and error, but one place to start is reading through threads like this one where others have tried to do this.

Once you have succeeded in doing that, then you can apply the shader effects to the window itself and it may/should affect the pixels captured therein. Certainly not a common task, but with some experimentation you could get some interesting results.