aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickmousearea
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2016-01-192-0/+42
|\ | | | | | | Change-Id: Ieb48911638b5c1acdfd4dee8aa19dca9be99a1f6
| * MouseArea: fixed a crash in propagate()Liang Qi2015-11-262-0/+42
| | | | | | | | | | | | | | | | Should not propagate without window. Task-number: QTBUG-49100 Change-Id: Ieda3a8357283f8d07d4ffc0cc62c4e15645d7e5a Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* | tests/quick: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).Friedemann Kleint2015-07-271-11/+11
|/ | | | | | | | | | | | - Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer). - Replace Q[TRY]_VERIFY(smartPointer == 0) by Q[TRY]_VERIFY(smartPointer.isNull()). - Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) and add casts where necessary. The values will then be logged should a test fail. Change-Id: Ib9f4c2486af23c47990be4b9e004b965de226dcc Reviewed-by: Mitch Curtis <mitch.curtis@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>
* MouseArea: Fix cancelling the double click when the windows loses focusOlivier Goffart2014-09-032-8/+53
| | | | | | | | | | Without this, the next click is not received after the windows loses focus while we double clicked but not released the mouse. This may happen if the onDoubleClicked opens a new window Change-Id: I86742de2bb1ea4c9657b9d5e90472d093293177d Reviewed-by: Alan Alpert <aalpert@blackberry.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>
* Add containsPress property to MouseAreaMartin Jones2014-07-162-0/+85
| | | | | | | | | | | | | | | | It is very common to use pressed and containsMouse properties together to highlight a pressed item, e.g. property bool highlighted: pressed && containsMouse The containsPress property allows simplification and optimization of user code. [ChangeLog][QtQuick] Add containsPress property to MouseArea Task-number: QTBUG-40130 Change-Id: Ie286d431154eb37a99e57e4cf881d68d7cbbe31d Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
* Introduce MouseArea.drag.smoothedKevin Funk2014-05-141-0/+45
| | | | | | | | | | | [ChangeLog][QtQuick] Added property MouseArea.drag.smoothed for toggling whether the drag target is moved to the current mouse position after a drag operation has started. Task-number: QTBUG-38539 Change-Id: I989b51bc83fc24c64b84ac8e9a50b352e674e8f8 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-02-111-1/+0
|\ | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4ssa.cpp src/qml/jsruntime/qv4arrayobject.cpp src/qml/jsruntime/qv4context.cpp Change-Id: Ied5b23bec4dc14abe51127c507aed668f855c1e1
| * Revert "Skip unstable test"Liang Qi2014-02-031-1/+0
| | | | | | | | | | | | | | | | | | | | This reverts commit 8e0c5b59f57b51a0dc80d3d8274202776c6e03df. This test doesn't fail any more. Task-number: QTBUG-23976 Change-Id: I77704e7811c4c335cb5836ba7645a8804c13e12d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* | fix whitespaceOswald Buddenhagen2014-01-222-2/+2
|/ | | | | | | remove trailing spaces and expand tabs Change-Id: Ieacb9d096b612c45d1a64700044c114d1f7522bc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* When the MouseArea loses grab, an active drag should be cancelled.Robin Burchell2013-11-301-0/+52
| | | | | Change-Id: Icc784dd3265c211d9b077b692464591a41976354 Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* Don't propagate mouse events to disabled MouseAreasAlan Alpert2013-11-052-0/+61
| | | | | | | | Task-number: QTBUG-34368 Change-Id: I28d4f57e51300f12a7bab5d215933762102f3916 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Expose drag threshold in MouseAreaJens Bache-Wiig2013-09-131-0/+70
| | | | | | | | | | | | | | | | | | | | In several cases such as for creating a Slider, it is useful to have a 0 pixel threshold in order to initiate a drag operation. We have previously hardcoded this to a platform dependent (usually 10 pixel) value for MouseArea. Note that we have no way of indicating the version/revision number in a grouped property for documentation at the moment. In addition we deliberately had to remove the REVISION from the property because it is blocked by QTBUG-33179. However, since this is not a user-creatable type it should not cause any issues in practice. This patch adds MouseArea.drag.threshold in order to improve on this. Change-Id: Ia4871e64fab39e30c4494f00be99ad38cdd630df Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Add support for external drag and drop in Quick items.Chris Meyer2013-09-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add dragType enums with values of None, Automatic, Internal (default). Setting to Automatic allows startDrag to be called automatically. Setting to Internal (default) retains old behavior. Add mimeData to Drag item to enable external drags. Call startDrag to start drag manually or change from internal drag to external drag. Added events dragStarted and dragFinished that get invoked from startDrag. Mime data must be specified in the mimeData property as mime-type / data pairs. Moved QQuickDrag from qquickmousearea* files to qquickdrag* files to reduce header interdependencies that caused linking errors in other modules and also to improve code organization. Allow DropArea to receive and process external data. Introduced new variable containsDrag to QQuickDropAreaPrivate. This replaces mimeData which was previously being used to determine if a drop operation was currently occurring. The problem was that mimeData was being externally destructed. Also introduced accessor methods for getting color, html, image, text, and urls out of the drop. This facilitates dropping of external data of those types onto a DropArea. Added example quick/externaldraganddrop. Task-number: QTBUG-27498 Change-Id: I1420df7c161ea3399e49a23305273e106baa246f Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* Stabilize tst_qquickmousearea.Friedemann Kleint2013-08-232-411/+387
| | | | | | | | | | | | Replace createView() by initView(), instantiate windows on stack or use QScopedPointer. Center view in available geometry and make sure the mouse cursor is outside, since otherwise it can interfere with drag->active(). Remove insignification introduced by c1fbee270f50c44f47d4eb287765ad60f362c87a . Task-number: QTBUG-33006 Change-Id: I8fc661444bc42899dfa3d87887c594270483e508 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Dragging MouseArea nested in Flickable does not work with touch to mouseMartin Jones2013-08-191-8/+5
| | | | | | | | | | | | | A MouseArea with a drag target nested in a Flickable does not work. This is due to QQuickWindow calling childMouseEventFilter() twice - once in sendFilteredTouchEvent() and later in sendEvent(). Since childMouseEventFilter() has already been called, deliver the mouse event directly in sendFilteredTouchEvent(). Task-number: QTBUG-32920 Change-Id: I22acee3c66ee6c06e71c9c876fb02dbcb6119a8d Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* Marking tst_qquickmousearea as insignificant on winSimo Fält2013-08-151-0/+2
| | | | | | | | This test seems flaky in windows. Task-number: QTBUG-33006 Change-Id: I1c67e1a498e4c5765580a316504e04776af5e109 Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Fix hover after press eventFrederik Gladhorn2013-04-272-0/+57
| | | | | | | | | | | | | | | When a mouse press event was rejected, we would unconditionally cancel the hover and claim that the mouse is not contained any more. Instead check if the mouse left and only then cancel the hover state. Task-number: QTBUG-30783 Change-Id: I5fac6f3a1f2807ef03e07982c603492d40d2a249 Reviewed-by: Florian Boucault <florian@boucault.net> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* a nested Window automatically becomes transient for its parentShawn Rutledge2013-04-101-1/+1
| | | | | | | | | | | | | | | | If you declare Window { Window {}} or Window { Item { Window {}}} the inner window will automatically become transient for the outer one. The transient relationship must be set before the inner window becomes visible though, so declaring visible: true doesn't always work, depending on initialization order. It's OK if you assign visible (or call show()) later on when the user needs to see the transient window for the first time. Also added documentation. Change-Id: I888c3b9da6d44d11516227c085bcc12a5ccb5e81 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Merge branch 'dev' into stableSergio Ahumada2013-03-202-32/+34
|\ | | | | | | | | | | This starts Qt 5.1 release cycle Change-Id: I6178a580b4c99aded1a69032a02169cff502b71d
| * Autotests w CONFIG+=parallel_test don't depend on activation or focusShawn Rutledge2013-03-041-26/+23
| | | | | | | | | | | | | | | | | | | | If the test does requestActivate() or relies on isFocusWindow(), the test cannot be parallel_test. Also, a lot of the tests don't actually need the window to be active, only exposed; and waiting only for exposed is likely to make them more stable. Change-Id: I0845b9b12ddf7f0c8906d9738a3e26d46ab98820 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
| * pressedCanceledOnWindowDeactivate pops up a second windowShawn Rutledge2013-03-042-6/+11
| | | | | | | | | | | | | | | | in order to cause the first one to be deactivated. Task-number: QTBUG-29953 Change-Id: I7fec66b07976b2afc78941d39c593f99ea484522 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* | Fix jump and property changes on first move when dragging a Flickable.Andrew den Exter2013-03-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes a regression introduced by https://codereview.qt-project.org/48690 whereby on the first mouse move the contentItem was moved the total distance from the touch point to where the drag distance was exceeded. For large drag thresholds this causes a noticeable jump. Reverting the dragStartOffset portion of that change fixes the regression. That same change was also resposible for the property update regression https://codereview.qt-project.org/49768 attempted to fix. That change is also reverted as it was unnecessary and may have introduced some regressions of its own. Task-number: QTBUG-30032 Change-Id: I7723b459cc5a6a0731893aeb6332d00cad1bd79b Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
* | Smooth dragging an item with MouseArea.Andrew den Exter2013-03-141-18/+20
|/ | | | | | | | | | Calculate drag distance relative to the mouse position when a drag is detected rather than the press position so there isn't a large change in position on the first move. Task-number: QTBUG-30188 Change-Id: I5c2269c2228668a3842e18f65167637497b3beb4 Reviewed-by: Joona Petrell <joona.petrell@jollamobile.com>
* Flickable shouldn't grab the mouse until it starts an effective move.Andrew den Exter2013-02-221-2/+2
| | | | | | | | | | If the boundBehavior prevents the flickable from moving its content item in response to a drag it shouldn't grab the mouse as that will prevent a parent MouseArea or Flickable from handling the drag. Task-number: QTBUG-29718 Change-Id: I3a1be4ed0132b91dca2fb0387ecefd39275a52da Reviewed-by: Alan Alpert <aalpert@rim.com>
* MouseArea shouldn't grab the mouse until there is an effective drag.Andrew den Exter2013-02-222-0/+112
| | | | | | | | | | A MouseArea shouldn't prevent a parent MouseArea or Flickable from handling a drag event unless it is going to do something useful with it. Task-number: 29717 Change-Id: I24016994f6cf9116382ef7faeb50b10e5716e10e Reviewed-by: Alan Alpert <aalpert@rim.com>
* A MouseArea should not receive move or release events if the press was not ↵Michael Brasser2013-02-142-0/+38
| | | | | | | accepted. Change-Id: If70650d7150b224f4460697a953611dd37d57af1 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Ungrab mouse when FocusAboutToChange instead of LeaveFrederik Gladhorn2013-01-242-12/+16
| | | | | | | | | | | | | | | | | | | Commit 7b2e2117162594a2d0234bb02408f5b5a446488b introduced a regression in mouse handling: When moving the mouse out of the window it would cancel all further mouse events. That is actually not wanted (eg scroll bars). Instead ungrab the mouse when the focus changes, that means the mouse handling with popups works and the scrollbar use case is also fixed. All the tests related to this seem quite timing sensitive, so try some more QTRY_VERIFY. Remove the parallel_test so that more cpu time will actually let the tests pass more reliably. Change-Id: I90586b05f461d3762728a466d71bcb967e03d14b Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@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>
* Fix compiler warnings in declarative tests.Friedemann Kleint2012-12-201-3/+0
| | | | | | | | | | | | - Unused variables - Missing enumeration values in switch - truncation from double to float - truncation from size_t to int - Missing initializers - Mix of operator & and bool | Change-Id: Ib212aeea41befef193f12300a1d9814a60f183af Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Add a hidden XandYAxis enum valueAlan Alpert2012-12-155-6/+6
| | | | | | | | | For Qt 5 XandYAxis is being renamed to XAndYAxis to more consistently follow capitalization rules. Add an undocumented XandYAxis variable to ease porting. Change-Id: Id9e41dd5578373f5f557937da889a9326ff12e53 Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
* Renamed QQuickItem::pos property to positionShawn Rutledge2012-11-291-1/+1
| | | | | | | | | Abbreviated property names are less descriptive so we don't have many of them. Might as well be consistent. QWindow::pos was already renamed. Change-Id: Ib52673e68e7dc902b2f8942dba6b899074b2538b Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* All QWindow properties that have "window" in them have been renamed.Shawn Rutledge2012-11-081-22/+22
| | | | | | | Depends on patch Ie4424ec15fbdef6b29b137f90a2ae33f173edd21 in qtbase. Change-Id: I9614cc2c7ed119c663b3f6f99267483e291e529c Reviewed-by: Samuel Rødal <samuel.rodal@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>
* Set the Qt API level to compatibility mode in all tests.Thiago Macieira2012-08-011-0/+1
| | | | | | | | | | Qt 5.0 beta requires changing the default to the 5.0 API, disabling the deprecated code. However, tests should test (and often do) the compatibility API too, so turn it back on. Task-number: QTBUG-25053 Change-Id: I6988c2360e9d88916311374a0c910bfc5b607439 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix resolution of cursor when items are overlapping.Andrew den Exter2012-07-261-0/+33
| | | | | | | | | | | | If MouseArea with cursorShapes are overlapping then cursor shape of the foremost item under the mouse cursor should be shown, but because the hover events are delivered to the foremost items first the opposite is occuring. This makes QQuickWindow responsible for correctly setting its own cursor instead of relying on items to work it out amongst themselves. Change-Id: Iedf144c583dfa3d1ff441e19db9601b5e171902a Reviewed-by: Martin Jones <martin.jones@nokia.com>
* QQuickCanvas renamesAlan Alpert2012-07-171-368/+368
| | | | | | | | | | | | | | | | QQuickCanvas is now called QQuickWindow QQuickCanvas::rootItem is now QQuickWindow::contentItem QQuickItem::canvas is now QQuickItem::window QQuickItem::ItemChangeData::canvas is also renamed window QQuickCanvas::grabFrameBuffer is now QQuickWindow::grabWindow The functions related to the color property have dropped the clear from their names. The first three changes have interim compatibility measures in place to ease the transition. Change-Id: Id34e29546a22a74a7ae2ad90ee3a8def6fc541d2 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* MouseArea: use current value of drag.axisAlberto Mardegan2012-07-162-0/+85
| | | | | | | | | | | | | If the drag.axis is changed while a drag operation is in progress, put it into action immediately. This allows, for example, start a dragging operation out of an item in a scrollable ListView to anywhere on the screen. See the linked bug number for an example. Task-number: QTBUG-26440 Change-Id: Id4219d44d1066dd962319086ac1f2a2a75bb2525 Reviewed-by: Damian Jansen <damian.jansen@nokia.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
* pressed and pressedButtons don't work when multiple buttons are pressedMartin Jones2012-07-112-0/+140
| | | | | | | | | | | | | | | The pressed property would react to any mouse event, regardless of whether it was in acceptedButtons, or there were other buttons still pressed. It will now remain true while any button in acceptedButtons is pressed. The pressedButtons property could contain buttons not in the acceptedButtons mask. It will now only contain buttons that are in the acceptedButtons mask. Task-number: QTBUG-26458 Change-Id: I6b25cc36a58c113de062d530761dc179d7ef4a5a Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Report correct mouse position when made visible with hoverEnabled.Michael Brasser2012-07-041-1/+0
| | | | | | Task-number: QTBUG-24282 Change-Id: I778b2db18c28e2b33690531ec19eb24ecf444a38 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Adjust MouseArea autotest to check mouse events with transformationsAdriano Rezende2012-06-302-0/+80
| | | | | | | Tests mouse events with graphical transformations applied to the element. Change-Id: I4b69e35cde4125aa047fa18357b22b898da92c20 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Add tests for clicking and dragging with right and middle buttons.Andrew den Exter2012-06-223-21/+159
| | | | | | Task-number: QTBUG-24461 Change-Id: I2c8b3455cb3aead5df7dfd85f65eb633a552b881 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Fix setting drag properties in mousePress.Andrew den Exter2012-05-142-0/+67
| | | | | | | | | Cache the dragX and dragY properties after the onPressed signal has been emitted to allow for deferred creation of the drag object or changes to the axis property in the handler. Change-Id: If154e661359c82e957fcf0cbc11ccc1f75bee919 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Improve test to use actual double click timeout.Frederik Gladhorn2012-04-231-6/+9
| | | | | | | | I'll keep the function marked as skip since I have no clue if this is even remotely connected to the issues it was having. Change-Id: I04b2a4f61321553804d29ef076178ea7c63b0deb Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Replace usage of QCursor, and update hoverVisible test.Michael Brasser2012-03-281-3/+1
| | | | | | | | QCursor::pos() doesn't work well with mouse events generated by the test framework. Change-Id: I62ee2228c194f21cf17f6271c662056a90c5ef2d Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Remove unneeded dependencies to QtWidgets and QtOpenGLLars Knoll2012-03-121-1/+0
| | | | | Change-Id: I43bb54524f5786a838073df8812107dda7b0d56e Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Fix MouseArea autotest.Laszlo Agocs2012-03-121-4/+9
| | | | | | | | | The hover test seems to be simply wrong. The double click tests worked before due to the obscure handling of double click but were somewhat incorrect in any case. Change-Id: Ie5690e26eb5921fe149e128d24d331f52a5a9075 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Add mouse wheel events handler to MouseAreaLuis Gabriel Lima2012-03-102-0/+45
| | | | | | | | | | | | 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>
* Changed quick tests to work from install directoryKurt Korbatits2012-03-071-3/+1
| | | | | | | | | - Changed tests to use TESTDATA - added check for cross_compile option to skip when sources not available Change-Id: I1f382794ff982bbc07fc20438a4e4a8c8b8d565f Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>