Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.7.0
-
None
Description
Nothing is drawn when a layer effect is applied on the root item. A minimal dummy example:
import QtQuick 2.7 import QtQuick.Window 2.2 Window { id: window width: 360 height: 360 visible: true title: "contentItem" contentItem.layer.enabled: true contentItem.layer.effect: ShaderEffect { } Text { text: "Content" font.pixelSize: 72 anchors.centerIn: parent } }
An example use case is to blur or desaturate the content (in a task switcher) when the application is not active. It works as long as the item is any other item than the root item:
import QtQuick 2.7 import QtQuick.Window 2.2 import QtGraphicalEffects 1.0 Window { id: window width: 360 height: 360 visible: true title: "otherItem" Item { id: otherItem anchors.fill: parent layer.enabled: !window.active layer.effect: FastBlur { source: otherItem radius: 32 } Text { color: "green" text: "Other" font.pixelSize: 72 anchors.centerIn: parent } } }
Applying a layer effect on ApplicationWindow::contentItem does not apply to Qt Quick Controls 2 popups, which are re-parented to ApplicationWindow::overlay to ensure that they always appear on top of the content. The structure is:
Window::contentItem ├─ ApplicationWindow::contentItem └─ ApplicationWindow::overlay
Therefore being able to apply a layer effect on Window::contentItem would be nice.
Attachments
Issue Links
- resulted from
-
QTBUG-54044 Please add ApplicationCover
- Open