Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-122340

MultiEffect - Wrong initial position of the shadow (MultiEffect)

    XMLWordPrintable

Details

    • All
    • ee975a136 (dev), 0666759d4 (6.7), 4bffe40db (tqtc/lts-6.5)

    Description

      See ExampleShadow.zip for a minimal example. The position of the shadow is wrong until the window is resized. In our application we also have a "workaround" with a Timer but that is not working in the minimal example.

      It looks like the resizing through the layout is a problem. When the implicit size of the Tile is near the final result (300) everything works fine. 1 was choosed here to clearly show the issue.
      We use the implicit sizes in layouts to ensure the available size is used by all members of the layout uniformly independent from the content of the members.

      import QtQuick
      import QtQuick.Controls
      import QtQuick.Layouts
      import QtQuick.Effects
      
      ApplicationWindow {
      	id: appWindow
      
      	height: 500
      	title: qsTr("Hello World")
      	visible: true
      	width: 800
      
      	RowLayout {
      		spacing: 100
      
      		anchors {
      			fill: parent
      			margins: 100
      		}
      		Tile {
      		}
      		Tile {
      		}
      	}
      
      	component Tile: Rectangle {
      		Layout.fillHeight: true
      		Layout.fillWidth: true
      		color: "lightgreen"
      		implicitHeight: 1
      		implicitWidth: 1
      		radius: 10
      
      		layer {
      			enabled: true
      
      			effect: MultiEffect {
      				shadowEnabled: true
      				shadowOpacity: 1
      				shadowScale: 1.025
      				shadowVerticalOffset: 7
      			}
      		}
      	}
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kagro Kaj Grönholm
            larss Lars Schmertmann
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes