aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickevents_p_p.h
Commit message (Collapse)AuthorAgeFilesLines
...
* | Move detection of event type to separate functionsFrederik Gladhorn2016-07-111-0/+4
| | | | | | | | | | Change-Id: Id7fc9df6b57c63f9cbdbc96f3e141ee509782e59 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Add QQuickPointerEvent::asMouseEventFrederik Gladhorn2016-07-091-14/+7
| | | | | | | | | | | | | | | | This makes the transition to the new events easier, I could imagine that this can be removed again later. Change-Id: Idecf6eeb3a96d1f75d46cc42ccb2f58d1312eb25 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* | Remove const from events passed into QQuickPointerEventFrederik Gladhorn2016-07-091-6/+6
| | | | | | | | | | | | | | | | | | This allows resetting the local position of events from the outside which helps when using the events for items expecting the old event types. Change-Id: Ifbcb8ee4986e252d791712c8ba612463ac209a68 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* | Merge overloads of QQuickPointerEvent::resetFrederik Gladhorn2016-07-081-2/+9
| | | | | | | | | | | | Change-Id: I9f76905dfc6ad21394a4ab08cf6684e91213dbde Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Simplify parameters to QQuickPointerEvent::resetFrederik Gladhorn2016-07-081-2/+2
| | | | | | | | | | | | | | | | We don't need the device passed in, but can infer it. Change-Id: I95479493431f8ca8047bcf124c295081d4895d6c Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | QQuickPointerEvent::reset move to .cpp fileFrederik Gladhorn2016-07-081-41/+2
| | | | | | | | | | | | Change-Id: Ib84d9fe2a3837f4f37087f7802eeb7570bb2baf7 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | QQuickPointerEvent::reset return thisFrederik Gladhorn2016-07-081-2/+4
| | | | | | | | | | | | | | | | | | Makes it possible to use it as: deliverEvent(pointerEvent->reset(qevent)); Change-Id: I653445c23696df384987ec8e948cb37ee312f217 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | PointerEvent point: setAccept should default to trueFrederik Gladhorn2016-07-081-1/+1
| | | | | | | | | | | | Change-Id: I8212120aa31aaededc0a62e598c512fc29616b1b Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | add QQuickPointerEvent and QQuickPointerDeviceShawn Rutledge2016-07-071-0/+258
|/ | | | | | | | | | | | | | | | | | | | | QQuickPointerEvent is first of all a wrapper for mouse and touch events to help unify event delivery. Because the instances are reused between deliveries (as in change 0ac9389dbd7facaa424dc175e5f5dac514630eef), it is allowed to be a QObject. This will facilitate exposing pointer events to QML later on, as with the other event classes in qquickevents_p_p.h. It allows both device-agnostic and device-specific handling of point-based interaction using mice and touchscreens (tablet support will come later). The interface of QQuickPointerDevice is a superset of QTouchDevice plus the relevant mouse and tablet device info. The instances are long-lived, and included by pointer in each QQuickPointerEvent. Applications and device-specific event handlers can use the device info to filter out irrelevant events. Change-Id: Iacb42d41889a9a8634d57331ec6cc65c6b36f71f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* QQuickMouseEvent and QQuickWheelEvent: default init in constructorShawn Rutledge2016-07-061-2/+8
| | | | | | | | | c9389dbd7facaa424dc175e5f5dac514630eef removed the constructor params but also removed the initialization, which rightly resulted in warnings from Coverity. Change-Id: Ife72d9e6075368bdf39b945551a460214a2fd036 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QML: re-use event objects across signal emissions.Erik Verbruggen2016-05-261-14/+47
| | | | | | | | | | | This change creates a single key/mouse/wheel event for use in signals, and re-uses that event across emissions. This prevents allocating a new event (and it's QObjectPrivate data) for every key press / mouse move / wheel spin. Change-Id: I395f6ce3ed8588157e4175c8481351b330793fac Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add QQuickWheelEvent::inverted()Jan Arve Sæther2016-05-251-3/+5
| | | | | | | | | | | | When handling wheel events, it's useful to know whether or not "natural" scrolling was enabled on platforms like OSX where the scrolling direction can be reversed. It's especially useful when implementing components like Slider (see QTBUG-35972). This will soon be needed in QtQuick.Controls because we plan to remove the WheelArea. Change-Id: I2770e0aa39e7e54511d7f9f7cc12760580a55e5c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* MouseArea: add source property to mouse eventShawn Rutledge2016-03-111-1/+5
| | | | | | | | | | | | | | | It comes from the source() of the QMouseEvent which triggered it. This makes it possible to distinguish real mouse events from those that are synthesized from touch or tablet. And for this we need to import QtQuick 2.7 [ChangeLog][QtQuick][MouseArea] Added mouse.source property to enable distinguishing genuine mouse events from those that are synthesized from touch or tablet events. Change-Id: I568964f63981703bd23e05daac5288518f09d837 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* Updated license headersJani Heikkinen2016-01-191-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Fix license headers of QtQuick sources.Gunnar Sletta2013-09-301-1/+1
| | | | | Change-Id: I3750c47640bf21c3567c5fa1c4667e3e2552942e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add bool QQuickKeyEvent::matches(QKeySequence::StandardKey)J-P Nurmi2013-07-011-0/+3
| | | | | Change-Id: Iaa8392c1b113856fa80cd2507f8640050eb9bec2 Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Doc: Fix module name formatSze Howe Koh2013-04-231-1/+1
| | | | | | | | | | | | Follow the conventions at http://qt-project.org/wiki/Spelling_Module_Names_in_Qt_Documentation Qt3D -> Qt 3D QtLocation -> Qt Location QtScript -> Qt Script Change-Id: Id59cb209e0e0407d564de0bfaab73990e64a02e6 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add nativeScanCode to KeyEvent.Glenn Watson2012-07-031-0/+2
| | | | | | | | | Allow the Qt nativeScanCode value to be passed through to the QML event handler. Task-number: QTBUG-18590 Change-Id: If598e0d65adc0e9bc29cca773a0bda2c8037b661 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Propagate synthesized mouse events in parallel with touch.Shawn Rutledge2012-06-281-69/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old way of event propagation inside QQuickCanvas was to send the touch event through all elements, and if it was accepted along the way, stop. Otherwise generate a mouse event and propagate it through the items in the same way. With this patch the behavior is changed instead to do the propagation in parallel. The idea is to first send a touch, then a mouse event to each QML item (in paint order) that can potentially handle the events. When items filter their child elements, the same logic applies. Other changes/clarifications: - mouse events no longer get synthesized for more than one touch point - TouchPoints can be distributed to multiple Items - if an item accepts a touch point, it always gets updates, even if the point is stationary - events containing only stationary TouchPoints are discarded - PinchArea must accept any initial single TouchPoint in order to receive subsequent updates, even though it's not pinching yet. This means if PA is on top, items underneath don't get touches. New unit tests showing this behavior were added. This patch was written by Frederik Gladhorn, Laszlo Agocs and Shawn Rutledge. Due to the complexity of the logic some refactoring was done. QQuickMouseEventEx has been removed because it inherently relied on using the QEvent d pointer. Change-Id: If19ef687d7602e83cc11b18d2fecfbbdb4e44f5c Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Null out the d pointer in QQuickMouseEventEx dtorLaszlo Agocs2012-05-211-0/+5
| | | | | | | | | Otherwise every single app will assert in ~QEvent when QML_TRANSLATE_TOUCH_TO_MOUSE is enabled. Change-Id: Ib0590a980cb00b913ec096bcdfba57fffaa19eb1 Reviewed-by: Shawn Rutledge <shawn.rutledge@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove unnecessary exportsMatthew Vogt2012-05-181-2/+2
| | | | | | | | | Reduce library load time by removing any exports which are not required by existing clients. Task-number: QTBUG-24768 Change-Id: Ia5754d6f97bb2ed46e290820a5b092f85a4bc5b0 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Add mouse wheel events handler to MouseAreaLuis Gabriel Lima2012-03-101-0/+38
| | | | | | | | | | | | This patch was based on the attached patch in QTBUG-7369. It basically exposes the wheel events to MouseArea via the onWheel signal. The current API is based on the new QWheelEvent API introduced by this patch: http://codereview.qt-project.org/#change,12532 Task-number: QTBUG-7369 Change-Id: Id58513715c2d0ae81e3a69e9e1ed400bbae07507 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Merge master <-> api_changesMatthew Vogt2012-03-051-2/+12
|\ | | | | | | Change-Id: Iad2f07b989b25349fd2d4fff010e24dcd5a1688f
| * Use velocity from touch events only when they are validLaszlo Agocs2012-03-021-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the capability flags to the extended mouse events. Otherwise it is not possible to tell if the velocity is valid. While the original version is fine if velocity is guaranteed to be available whenever QT_TRANSLATE_TOUCH_TO_MOUSE is set, some platform and driver combinations, e.g. the evdevtouch plugin that comes with Qt, do not provide velocity data in touch events. The touch-only mode of QML may be very useful in these cases too, we just need to fall back to the built-in velocity calculation. Change-Id: Iec5e7632a66380dc04c9435b09f5c173107bbe00 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* | Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-241-2/+2
|/ | | | | | | | | | | | | Symbols beginning with QDeclarative are already exported by the quick1 module. Users can apply the bin/rename-qtdeclarative-symbols.sh script to modify client code using the previous names of the renamed symbols. Task-number: QTBUG-23737 Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Remove commit headersAaron Kennedy2012-02-201-1/+0
| | | | | | | | These were used when we were porting from QtQuick 1 to QtQuick 2 but are no longer necessary. Change-Id: I0eeb7e13b4affdd6ab6c6dddea760afcdf38ee4f Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Use use touch events to generate mouse events in Quick canvas.Martin Jones2012-02-101-0/+55
| | | | | | | | | | | | Allowing the canvas to deal with mouse event emulation provides a couple of advantages: 1. touches outside a reactive area can be ignored, allowing a touch within a reactive area to become the "mouse touch". 2. we can extend the mouse events with data available in touch events for use within the quick elements; specifically velocity in this case. Change-Id: Id9df397f1a3a03dbda2ef5dcf6189e7eb3377356 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: If39bd256b0fa85eba17ea30f8ab87ea27d758908 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update obsolete contact address.Jason McDonald2012-01-231-1/+1
| | | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I6a730abc0c396fb545a48b2d6938abedac2e3f1c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I0a8d99909cac867dce72da70b1bbcb649989a51b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Say hello to QtQuick moduleKent Hansen2011-12-021-0/+145
This change moves the QtQuick 2 types and C++ API (including SceneGraph) to a new module (AKA library), QtQuick. 99% of this change is moving files from src/declarative to src/quick, and from tests/auto/declarative to tests/auto/qtquick2. The loading of QtQuick 2 ("import QtQuick 2.0") is now delegated to a plugin, src/imports/qtquick2, just like it's done for QtQuick 1. All tools, examples, and tests that use QtQuick C++ API have gotten "QT += quick" or "QT += quick-private" added to their .pro file. A few additional internal QtDeclarative classes had to be exported (via Q_DECLARATIVE_PRIVATE_EXPORT) since they're needed by the QtQuick 2 implementation. The old header locations (e.g. QtDeclarative/qquickitem.h) will still be supported for some time, but will produce compile-time warnings. (To avoid the QtQuick implementation using the compatibility headers (since QtDeclarative's includepath comes first), a few include statements were modified, e.g. from "#include <qsgnode.h>" to "#include <QtQuick/qsgnode.h>".) There's a change in qtbase that automatically adds QtQuick to the module list if QtDeclarative is used. Together with the compatibility headers, this should help reduce the migration pain for existing projects. In theory, simply getting an existing QtDeclarative-based project to compile and link shouldn't require any changes for now -- but porting to the new scheme is of course recommended, and will eventually become mandatory. Task-number: QTBUG-22889 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Change-Id: Ia52be9373172ba2f37e7623231ecb060316c96a7 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>