Re: [Qt-qml] How to ignore MouseArea signals
Hello, Is there a reason why accepted isn't handled in the other mouse events? Cheers, Jerome P. From: qt-qml-boun...@trolltech.com [qt-qml-boun...@trolltech.com] On Behalf Of ext Halton Huo [halton@intel.com] Sent: Wednesday, December 08, 2010 4:40 AM To: Jones Martin (Nokia-MS-Qt/Brisbane) Cc: qt-qml@trolltech.com Subject: Re: [Qt-qml] How to ignore MouseArea signals Thanks, http://bugreports.qt.nokia.com/browse/QTBUG-15929 is filed. On Wed, 2010-12-08 at 10:41 +0800, martin.jo...@nokia.com wrote: Log a bug. It would be good if you could suggest where the docs are lacking - i.e. where you started looking when this didn't work as expected. The accepted behavior is documented in the MouseArea signal documentation. BR, Martin. -Original Message- From: ext Halton Huo [mailto:halton@intel.com] Sent: Wednesday, 8 December 2010 11:56 AM To: Jones Martin (Nokia-MS-Qt/Brisbane) Cc: adriano.reze...@openbossa.org; qt-qml@trolltech.com Subject: RE: [Qt-qml] How to ignore MouseArea signals Woo, OnPressed works, thanks very much. The document need to be improved. Any process to do that? Cheers, Halton. On Wed, 2010-12-08 at 09:46 +0800, martin.jo...@nokia.com wrote: You need to accept in onPressed. accepted is ignored for any other event. BR, Martin. -Original Message- From: qt-qml-boun...@trolltech.com [mailto:qt-qml-boun...@trolltech.com] On Behalf Of ext Halton Huo Sent: Wednesday, 8 December 2010 11:42 AM To: Adriano Rezende Cc: qt-qml@trolltech.com Subject: Re: [Qt-qml] How to ignore MouseArea signals enabled does not match my case. I need receive the MouseArea signals but as well as those below the top item can receive the signals also. Refer to MouseEvent element document, seems accepted can do that. - accepted : bool Setting accepted to true prevents the mouse event from being propagated to items below this item. Generally, if the item acts on the mouse event then it should be accepted so that items lower in the stacking order do not also respond to the same event. But following code does not work as I wish MouseArea { anchors.fill: parent onClicked: { console.log(mouse.accepted=+mouse.accepted) mouse.accepted = false console.log(mouse.accepted=+mouse.accepted) } } Thanks, Halton. On Wed, 2010-12-08 at 02:55 +0800, Adriano Rezende wrote: On Tue, Dec 7, 2010 at 4:31 AM, Halton Huo halton@intel.com wrote: So my questions how to ignore the received signals to let other items to continue deal with those signals? You can set enabled property to false or ignore the event on mouse press. MouseArea { anchors.fill: parent onClicked: console.log(background clicked); } MouseArea { anchors.fill: parent enabled: false //onPressed: mouse.accepted = false; onClicked: console.log(foreground clicked); } Br, Adriano ___ Qt-qml mailing list Qt-qml@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-qml ___ Qt-qml mailing list Qt-qml@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-qml ___ Qt-qml mailing list Qt-qml@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-qml
Re: [Qt-qml] How QML file is parsed and linked and executed?
Hello, Example: import QtQuick 1.0 Rectangle { id:screen; width: 100; height: 100 Rectangle { id: one; width: 10; height: 10 Component.onCompleted: console.log(one) } Rectangle { id: two; width: 10; height: 10 Component.onCompleted: console.log(two) } Rectangle { id: three; width: 10; height: 10 Component.onCompleted: console.log(three) } Component.onCompleted: console.log(screen) } = output: screen three two one The top level's handler is first, then the children. Is this a reasonable generalization to make? Cheers, Jerome P. From: qt-qml-boun...@trolltech.com [qt-qml-boun...@trolltech.com] On Behalf Of Iliev Ivailo (EXT-ProData/Berlin) Sent: Tuesday, November 23, 2010 9:23 AM To: Kennedy Aaron (Nokia-MS-Qt/Brisbane) Cc: qt-qml@trolltech.com Subject: Re: [Qt-qml] How QML file is parsed and linked and executed? Hi, ok, thanks :) best regards, Ivo From: Kennedy Aaron (Nokia-MS-Qt/Brisbane) Sent: Tuesday, November 23, 2010 3:03 AM To: Iliev Ivailo (EXT-ProData/Berlin) Cc: qt-qml@trolltech.com Subject: Re: [Qt-qml] How QML file is parsed and linked and executed? Hi, As it says in the documentation, the order Component.onCompleted handlers are executed is not defined. Roughly speaking (as there are exceptions), elements are instantiated from top to bottom, and the onCompleted signals are executed in reverse order of instantiation. But don't rely on that behaviour. Cheers, Aaron On 22/11/2010, at 6:49 PM, ext ext-ivailo.il...@nokia.commailto:ext-ivailo.il...@nokia.com wrote: Hi, as you all know HTML and JavaScript are executed / or evaluated / form the TOP to BOTTOM. So if you have a source of 100 lines it will start from line 1 and will finish with the last one. When you know this you can somehow figure our some tricks you want to make and know what to expect. I have a QML file that I want to trace how it's reacting. Rectangle {onCompleted: {console.col(m1)}} Rectangle {onCompleted: {console.col(m2)}} and in the console output I have m2, m1. so does it mean that in QML we have stack popup priority of structure handling - you parse it from top to bottom and execute it form bottom to top? does it mean that my later element will always have Component.onCompleted before? Or this reverse order is just temporary or coincidence on my machine or we shall not expect any order of loading - everything will come when it comes? Best Regards, Ivo ___ Qt-qml mailing list Qt-qml@trolltech.commailto:Qt-qml@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-qml ___ Qt-qml mailing list Qt-qml@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-qml
[Qt-qml] Exporting enums to QML
Hello, I know there is no enum reserved keyword in JavaScript, but what is the preferred way to expose Q_ENUMS to QML? Thanks, Jerome P. ___ Qt-qml mailing list Qt-qml@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-qml
Re: [Qt-qml] FocusScope and Positioning
Hello, Thanks for your reply. I will add this information as usage guideline in the focus document. Currently, there isn't any content regarding how to use the FocusScope element. Thanks, Jerome P. From: Brasser Michael (Nokia-MS-Qt/Brisbane) Sent: Wednesday, November 10, 2010 3:46 AM To: Pasion Jerome (Nokia-MS-Qt/Oslo) Cc: qt-qml@trolltech.com Subject: Re: [Qt-qml] FocusScope and Positioning Hi Jerome, FocusScope is considered a visual element (like Item, it is a visual element that doesn't actually draw anything) with a geometry, so it needs an explicit size (e.g. binding its size to its children's size) to work properly within a layout. It certainly wouldn't hurt to make that more explicit in the docs -- is that something you are happy to do along with your other revisions in this area? Regards, Michael On 09/11/2010, at 6:28 PM, ext jerome.pas...@nokia.com wrote: Hello, I am revising the focus document and I noticed something unexpected. Here is a sample code: import QtQuick 1.0 Rectangle { width: 200; height: 200 Column { FocusScope { Rectangle {width: 50; height: 50; color: blue} } FocusScope { Rectangle {width: 50; height: 50; color: red} } } } What I would like is to place these two FocusScope on top of each other, instead the rectangles will be in front of each other. Removing the FocusScope element will do what I intended, but the addition of a FocusScope doesn't behave as (I, at least) expected. This issue might come up when people start wrapping their components in FocusScopes and the element which imports these components may not be aware of these FocusScope behaviors. Any workarounds? Cheers, Jerome P. ___ Qt-qml mailing list Qt-qml@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-qml ___ Qt-qml mailing list Qt-qml@trolltech.com http://lists.trolltech.com/mailman/listinfo/qt-qml