[Interest] [Development] Nested Mousearea don't pass events

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Mon May 20 16:10:22 CEST 2013


Il 20/05/2013 14:36, Matteo Brichese ha scritto:
> This is a sample of my code:
> import QtQuick 2.0
> Rectangle {
>      width: 1024
>      height: 768
>      MouseArea {
>           anchors.fill: parent;
>           onClicked: console.log("Click")
>       }
>      MouseArea {
>          anchors.fill: parent;
>          onDoubleClicked: console.log("Double Click")
>      }
> }
> I can only see logs of the double click.
> I was hoping that if I single click the last mousearea the event passed to the second one, but it don't work, is that a bug?

Being a question about developing *with* Qt, the right list to post this 
message is the interest list, not the development list.

Anyhow, I think you just miss a "propagateComposedEvents: true" in the 
second MouseArea. Note that for a double click you're still going to 
receive the first click in the bottom MouseArea (in other words I expect 
that a double click will print "Click" and "Double Click").

Hope this helps,
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Software Engineer
KDAB (UK) Ltd., a KDAB Group company
Tel. UK +44-1738-450410, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions

More information about the Interest mailing list