[Development] Behaviour change of opacity property in QtQuick 2.0
Kim M. Kalland
kim.kalland at nokia.com
Wed Jul 18 17:28:52 CEST 2012
On 18.07.2012 13:47, ext Nils Jeisecke wrote:
> Hi,
>
> In QtQuick 1 an element with opacity == 0 is treated as invisible
> (e.g. it won't see mouse events).
> This has changed in QtQuick 2.0 which breaks existing code that
> assumes that opacity == 0 means !visible.
>
> This example illustrates the change. A mouse click will print:
> QtQuick 1.1: "CLICKED A"
> QtQuick 2.0: "CLICKED B"
>
> A workaround is to set "visible: opacity > 0"
>
> Is this change intentional?
>
> ---
>
> //import QtQuick 2.0
> import QtQuick 1.1
>
> Rectangle {
> width: 360
> height: 360
> MouseArea {
> anchors.fill: parent
> onClicked: console.log("CLICKED A")
> }
>
> Rectangle {
> anchors.fill: parent
> opacity: 0
> MouseArea {
> anchors.fill: parent
> onClicked: console.log("CLICKED B")
> }
> }
> }
>
> ---
> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development
Apparently, it was intentional: QTBUG-19193, and commit
9bf96613c1be7d4df7132a9c3c9ac1a8740f698f. It would be nice to know what
the arguments for changing the behaviour were...
Kim
More information about the Development
mailing list