[Development] Nested Mousearea don't pass events
joao morgado
joaodeusmorgado at yahoo.com
Sun Jun 2 03:09:38 CEST 2013
Hi
Thanks for this solution, I was having the same problem. But it only works for
QtQuick 2.0, it seems propagateComposedEvents it's not available in QtQuick 1.1 : (
Regards
João de Deus
________________________________
De: Sean Harmer <sean.harmer at kdab.com>
Para: development at qt-project.org
Enviadas: Sábado, 1 de Junho de 2013 18:08
Assunto: Re: [Development] Nested Mousearea don't pass events
On 20/05/2013 13:36, Matteo Brichese wrote:
> Hi everyone, I'm having some issue on passing the right event from a mousearea to another.
>
> 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?
>
> I'm using Qt5.0.2
You need to set
propagateComposedEvents: true
on the top MouseArea and in the signal handler of the top MouseArea set
mouse.accepted = false
so that it propagates clicks, doubleClicks etc to the underlying
MouseArea. See
http://doc-snapshot.qt-project.org/qt5-release/qtquick/qml-qtquick2-mousearea.html#propagateComposedEvents-prop
Cheers,
Sean
--
Dr Sean Harmer | sean.harmer at kdab.com | Senior Software Engineer
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel. Sweden (HQ) +46-563-540090, USA +1-866-777-KDAB(5322)
KDAB - Qt Experts - Platform-independent software solutions
_______________________________________________
Development mailing list
Development at qt-project.org
http://lists.qt-project.org/mailman/listinfo/development
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20130601/2ca6c32a/attachment.html>
More information about the Development
mailing list