Commit Graph

166 Commits

Author SHA1 Message Date
Volker Hilsheimer 528807e80c Tests: Silence compiler warnings when checking bitfields
MSVC complains about us comparing a bool to a quint32, which is the
underlying type for the bitfields in QQuickItemPrivate. Fix that by
replacing QCOMPARE(A, true/false) with the corresponding QVERIFY.

Pick-to: 6.5
Change-Id: I7f50e6276b592c9abe8ceaea95c9283a0c431c78
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
2023-04-21 16:43:23 +02:00
Santhosh Kumar 2af8743aab Fix mouse inside MouseArea (containsMouse) for press event
In MouseArea, containsMouse (mouse inside MouseArea) flag is enabled for
press event irrespective of whether its accepted or not. This creates
containsMouse to be enabled always for this corresponding item leaving
no option to reset.

To fix this issue, containsMouse flag is enabled only if the press
event is accepted for mouse handler.

Fixes: QTBUG-110594
Pick-to: 6.4 6.5
Change-Id: Ibb0e89529ccebc3063330c22b8b3501b2917d78f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-02-09 09:05:46 +00:00
Santhosh Kumar f1fa9e5da2 Fix qml warnings for qquickmousearea test cases
Triggering quickmousearea test suite generates qml warnings and its due
to change in qt6 qml compiler. These warnings has been fixed in this
patchset.

Pick-to: 6.5
Change-Id: I38ba666c4ae77f1e82292ab748ca3f4bb6f34d63
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-02-08 13:49:04 +00:00
Sami Shalayel e1cebe8128 QQuickMouseArea: do not overload pressed-signal
Renames the pressed() getter of the pressed property in QQuickMouseArea
to isPressed() to avoid overloading the pressed()-signal.
Signals should not be overloaded. Also, it makes code generation in
qmltc more complicated.

Task-number: QTBUG-110029
Change-Id: I2373f4fe97b1e955b815825003bc746f2eaf43be
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-01-24 13:41:45 +01:00
Amir Masoud Abdol c2d37f9646 Retire the qt_parse_all_arguments
Task-number: QTBUG-99238
Change-Id: Ia11c9cbd7c06347319ab3674ec0cd8da0214747e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-01-20 16:40:42 +01:00
Oliver Dawes 000df08653 Fix masked MouseArea hovered state on visibility change
This fixes the issue where given two hoverable MouseAreas A & B where B
masks A, the `containsMouse` property of A will be incorrectly set to
true if the cursor is positioned above both A and B and the visibility
of A is toggled from true to false back to true.

This patch fixes the above issue by checking if the QQuickMouseArea is
marked as a hovered item in its windows QQuickDeliveryAgentPrivate(QDAP)
instance. If the QQuickMouseArea is masked by another QQuickMouseArea
then it will not be a in the QDAPs hovered items list and we skip
setting the hovered property on QQuickMouseArea, fixing the issue.

This patch also adds a test case to prevent future regressions.

Fixes: QTBUG-109567
Pick-to: 6.5 6.4
Change-Id: I5f024a097b56ef5e0836ca9f8ae547983a089b44
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-01-17 20:58:31 +00:00
Shawn Rutledge 0bb7b2e932 Allow OS-synthesized right clicks to be delivered
Since 15337aa91b891b49ffe76c96dd6fa6cd9bead2c2 we have been blocking all
OS-synthesized mouse events. But synthesizing right click from long-
press is becoming more common, so Qt Quick should be able to react to
those.

[ChangeLog][QtQuick] In case your operating system synthesizes a
right-click from a touchscreen long-press, synthetic right-button mouse
events are now delivered normally, so that e.g. TapHandler can react.
You can opt out by setting QT_QUICK_ALLOW_SYNTHETIC_RIGHT_CLICK=0.

Fixes: QTBUG-77902
Task-number: QTBUG-84179
Change-Id: I609041daf0e3e8ce1d1f3b0c78ae3bd264fec8a3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-10-26 20:40:07 +00:00
Shawn Rutledge 1a8a47d574 Use const QPointingDevices in tests
When a data-driven test has
    QTest::addColumn<const QPointingDevice *>("device");
QTestData::append() does a type check with QTEST_ASSERT if it's not an
exact match. That can result in a crash, apparently, although it's not
clear then how 59d967a8fb got through CI
the first time.

Amends 59d967a8fb

Task-number: QTBUG-107863
Task-number: QTBUG-107864
Change-Id: I383191b604eb504d49b0d51a23ecc45160f3383b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-10-23 10:38:05 +02:00
Shawn Rutledge 61a9612f5b MouseArea: don't get stuck in pressed state when disabling in press
In 8ace780b5a we fixed the case when
MouseArea hides itself on press. This time, the concern is when it
becomes _effectively_ disabled by disabling its parent on press.
(As explained in a comment on QTBUG-38364, the MouseArea.enabled state
is independent, but we can nevertheless also find out when the effective
enabled state changes.)

[ChangeLog][QtQuick][MouseArea] When a MouseArea becomes effectively
disabled due to a parent's enabled property being set false while the
mouse is pressed, the press will now be canceled.

Fixes: QTBUG-39806
Fixes: QTBUG-103788
Change-Id: I8d69b535b6e1b5d51ad1e030f52217de9ab541f1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-10-21 08:26:27 +02:00
Axel Spoerl b8791806a3 Skip nestedStopAtBounds when stolen focus cannot be re-gained
The test has been blacklisted on openSUSE Leap due to flakiness.
The flakiness results from system tray messages popping up, stealing
focus from test widgets and interfering with mouse emulation.

This patch adds functionality that tries to regain focus in case of an
interference. The test will time out, if that attempt fails.

Fixes: QTBUG-78153
Change-Id: Ifcab3990166bdf6b6fbc8a8cd4554b22130336c2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-10-20 21:37:57 +02:00
Marc Mutz 958cd3ee10 Port from container::count() and length() to size()
This is a semantic patch using ClangTidyTransformator as in
qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8:

  auto QtContainerClass = anyOf(
      expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o),
      expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o));
  makeRule(cxxMemberCallExpr(on(QtContainerClass),
                             callee(cxxMethodDecl(hasAnyName({"count", "length"),
                                                  parameterCountIs(0))))),
           changeTo(cat(access(o, cat("size"), "()"))),
           cat("use 'size()' instead of 'count()/length()'"))

a.k.a qt-port-to-std-compatible-api with config Scope: 'Container',
with the extended set of container classes recognized.

Change-Id: Idb1f75dfe2323bd1d9e8b4d58d54f1b4b80c7ed7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-10-07 23:38:48 +02:00
Richard Moe Gustavsen 750fe797e1 QQuickMouseArea: store hoverEnabled explicitly
The current implementation would not explicitly store if
hoverEnabled was set. Instead it would use acceptHoverEvents()
directly. The problem is that the latter will also need to be
set to false when a MouseArea is disabled, otherwise it will not
receive a HoverLeave event. But when doing so, we will no longer
know if hoverEnabled was set to true or false by setEnabled() or
by setHoverEnabled(). As such, when the MouseArea is enabled again,
we would no longer know if we should start to subscribe to hover
events or not.

This patch will therefore add en extra bool, hoverEnabled,
that lets us track the hoverEnabled state explicitly.

As a drive-by, also add some internal docs that explains
how a MouseArea differs wrt hover compared to e.g
HoverHandlers and other items.

Fixes: QTBUG-46460
Pick-to: 6.4
Change-Id: I34e078b3574030572bcf770750820959e98ecc4c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-09-21 07:50:10 +02:00
Lucie Gérard 1b9808737a Change the license of all CMakeLists.txt and *.cmake files to BSD
Task-number: QTBUG-105718
Change-Id: Id89ed14990804a5024183e75382cc539d4293da1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-09-07 17:01:30 +02:00
Alexandru Croitor a8431a4067 CMake: Don't use PUBLIC_LIBRARIES for tests and test helpers
Change-Id: I1cd769f85d5f82c43639d6787d98e536619249e6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-28 14:58:42 +02:00
Shawn Rutledge 718bef9d2c Don't ungrab for a TabletRelease event: wait for the synth-mouse release
Many QTabletEvents are not handled, so being able to "press a button"
or other kinds of basic UI interaction depend on tablet->mouse synthesis
in QGuiApplicationPrivate::processTabletEvent(). If a basic
mouse-handling Item like a MouseArea or Button grabs on _mouse_ press,
it needs to receive the _mouse_ release too; so DeliveryAgent must not
take away its grab until that happens.

Amends a97759a336

Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-98936
Fixes: QTBUG-102764
Fixes: QTBUG-103937
Change-Id: I6d75d988d617bc3ceb8465f939d0a69485278cdf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Doris Verria <doris.verria@qt.io>
2022-07-15 21:49:28 +02:00
Lucie Gérard 5a7b716474 Add license headers to cmake files
CMakeLists.txt and .cmake files of significant size
(more than 2 lines according to our check in tst_license.pl)
now have the copyright and license header.

Existing copyright statements remain intact

Task-number: QTBUG-88621
Change-Id: I72c89a98c42bbc9234d8495e9e503bec81d11037
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-07-08 10:41:06 +02:00
Lucie Gérard 0dc4fd240a Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.

Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-06-11 08:05:15 +02:00
Shawn Rutledge 5680f42a97 Add MouseArea autotest with second touchpoint while first is held
- Touch first finger
- Touch and release second finger
- Release first finger

QQuickMouseArea::pressed() must be emitted only once;
QQuickMouseArea::released() must be emitted at the end.

Pick-to: 6.3 6.2
Task-number: QTBUG-103766
Change-Id: I849bbbad67c4739bea0a241b396bf4cbbebdd2e0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-05-25 20:46:34 +02:00
Shawn Rutledge d92f1dfe05 MouseArea: don't override preventStealing on mouse release
In setPreventStealing() we call setKeepMouseGrab(); so it does not make
sense to override setKeepMouseGrab() in other places without even
checking the state of the preventStealing property.

Pick-to: 5.15 6.2 6.3
Fixes: QTBUG-103522
Change-Id: Ib4a2b01b814835715642aec83fac0a84debe2461
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-05-19 22:30:23 +02:00
Andreas Buhr 82b76e4eb5 Cleanup CMakeLists.txt files
A lot of CMakeLists.txt files defined QT_QMLTEST_DATADIR twice,
leading to a warning. This patch fixes these.

Pick-to: 6.2 6.3
Change-Id: I8b835fcddd3334f0ecac45cb72bd5763b3a5704d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-05-03 10:42:21 +02:00
Andreas Buhr 0452681b6e Blacklist failing tests in tst_qquickmousearea
Pick-to: 6.2 6.3
Task-number: QTBUG-103092
Task-number: QTBUG-101865
Change-Id: I5ee3092bbb74bd6779821ba881a6062126bfd6d4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-05-03 10:06:36 +02:00
Shawn Rutledge 089c3b15b9 MouseArea: don't get stuck in doubleClick if handler caused ungrab
The bug scenario went like this:
1) QQuickMouseArea::mouseDoubleClickEvent() emits doubleClicked
2) onDoubleClicked in QML hid the MouseArea somehow
3) QQuickMouseArea::ungrabMouse() is called; it sets
   d->pressed = Qt::NoButton and d->doubleClick = false (and others)
4) eventually we get back to the continuation of mouseDoubleClickEvent()
   which sets d->doubleClick back to true
5) mouse release: this MouseArea is not involved (no grab anymore)
6) next mouse press: QQuickMouseArea::setPressed() has
   if (!d->doubleClick)
       emit pressed(&me);
   pressed() is not emitted because of leftover state

So either we need to avoid setting d->doubleClick to true if d->pressed
has been set to Qt::NoButton in QQuickMouseArea::ungrabMouse(); or else
we should reorder the statements in mouseDoubleClickEvent() to set
d->doubleClick before emitting doubleClicked, so that it will not be
overridden after the QML handler is called. This patch takes the first
approach.

Fixes: QTBUG-35995
Fixes: QTBUG-102158
Pick-to: 6.2 6.3 5.15
Change-Id: Ibe5c9bfbc9c7a70772dd5ebfbc9ce401c6c226d3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-05-02 21:58:59 +02:00
Mitch Curtis f4ed331c65 Re-blacklist tst_qquickmousearea::pressAndHold on macOS CI
This is a partial revert of b0848d038b.
The test became flaky again in early February, 2022.

Grafana shows no failures for 6.2, so this only appears to be an
issue on dev and 6.3.

Task-number: QTBUG-82043
Pick-to: 6.3
Change-Id: Ic44e2e10d279a436323e8d9cda5f0096ec199450
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-03-22 07:13:24 +00:00
Volker Hilsheimer b1d0136192 Enable passing tests that were skipped on offscreen
grabWindow is now implemented for the offscreen plugin, so a large
number of tests relying on that functionality don't need to be skipped
any longer.

Change-Id: I85bfc9e4b327389055041b6187a54f88d9cf81d2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-03-07 18:19:43 +01:00
Fabian Kosmale 4f50697e6c Do not rely on transitive includes in tests
Change-Id: Icb68dbecab6f675352cd58333c82fa6648025367
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-02-14 12:38:10 +01:00
Shawn Rutledge c4ecd44884 Stop using deprecated QMouseEvent and QContextMenuEvent ctors
Needed after qtbase 6b2c9b81afdb3d1d9b7a2e87819e9545b14810f3

Change-Id: I117cd4d09b4219ddc97dd019419b4b971f9dbb8e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-02-10 10:15:20 +00:00
Shawn Rutledge b0848d038b Un-blacklist some passing tests
Task-number: QTBUG-75786
Task-number: QTBUG-82015
Task-number: QTBUG-82043
Task-number: QTBUG-82404
Task-number: QTBUG-85622
Task-number: QTBUG-85624
Task-number: QTBUG-88541
Task-number: QTBUG-95863
Pick-to: 6.2 6.3
Change-Id: I361afa8b78e2947b12194b6b1212e59db1b20b11
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-02-05 15:41:30 +00:00
Mitch Curtis e310dadef7 Consolidate test helpers into private libraries
Previously each test would include and build sources from the shared
folder. Now we make those sources a library, build it once, then have
each test link to it instead.

We also take the opportunity to move some helpers that qtquickcontrols2
had added into the quicktestutils library where it makes sense, and
for the helpers that don't make sense to be there, move them into
quickcontrolstestutils.

We add the libraries to src/ so that they are internal modules built as
part of Qt, rather than tests. That way we can use them in a standalone
test outside of qtdeclarative.

Task-number: QTBUG-95621
Pick-to: 6.2
Change-Id: I0a2ab3976fdbff2e4414df7bdc0808f16453b80a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-09-13 21:17:04 +02:00
Volker Hilsheimer ba1246c543 MouseArea: fix containsMouse behavior during visibility changes
QQuickItem returns whether it contains QGuiApplicationPrivate's
lastCursorPosition. Since that position stores the coordinate last seen
by Qt (the window border), it will always be within the window, and
within an item that covers that part of the window's border.

However, QQuickWindow stores the lastMousePosition as well, and resets
that value when it receives a QEvent::Leave. We can use that to test
whether the  window that contains the item has seen a Leave event, in
which case the item is definitely not under the mouse.

Notes on the test: That we use QPointF() as the "reset" value leave the
small possibility that the cursor might be at position 0,0 of the window
(ie inside the window), and the QQuickItem there will not be under the
mouse. We can't confirm this (through an expected failure test), as
QTest::mouseMove interprets a QPoint(0, 0) as "center of the window".

And since we can't simulate mouse moves outside a window's boundary
using QTest::mouseMove, the test needs to explicitly synthesize a
QEvent::Leave for the window.

Fixes: QTBUG-87197
Pick-to: 6.1 6.0 5.15
Change-Id: I04870d6e914092275d9d790312fc702fb99f2935
Done-with: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-02-12 19:48:25 +00:00
Fabian Kosmale 78ab4b8d8b Remove the qmake project files
Remove all qmake project files, except for examples which are used to
test that qmake continues to work.

Change-Id: Ic4abb72dc2dcd75df7a797c56056b6b3c5fe62ac
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-15 15:34:22 +01:00
Shawn Rutledge f1a9c9b427 Clean up and un-blacklist tst_QQuickMouseArea tests
- Use QQuickTest::showView() consistently to reduce boilerplate
- Use QTest::mouse*() where possible rather than constructing QMouseEvents
  (and potentially getting them wrong)
- Use QPointingDevicePrivate::firstPointExclusiveGrabber() on a specific
  device to check grab state rather than QQWindow::mouseGrabberItem()
- The warning "event went missing during delivery!" has been removed,
  so tst_QQuickMouseArea::nestedEventDelivery() shouldn't expect it

Pick-to: 6.0
Pick-to: 6.0.0
Task-number: QTBUG-86729
Change-Id: Ieb1af38c118dadf8cdf8ae19f92002207d71d5b5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-11-20 17:51:29 +01:00
Shawn Rutledge fd9e4920b3 Fix tst_QQuickMouseArea::notPressedAfterStolenGrab again
Most of the time, QQuickWindowPrivate::deliverMatchingPointsToItem()
doesn't need to call item->mouseUngrabEvent() because all grab changes
are notified via the connection from signal QPointingDevice::grabChanged
to slot QQuickWindowPrivate::onGrabChanged().  But in this case,
MouseArea only accepts the event, rather than taking the grab itself.
Therefore at the time the grab is "stolen", there was not yet any
grabber, because grabbing is done after delivery.  But we still need to
inform MouseArea that it's not getting the grab it expects to get, so
that it can reset its pressed state.  But we don't want it to be
redundant (other tests are counting events, and we don't want repeated
ungrabs to show up in those); so now we have to track whether the item
on which we're about to call mouseUngrabEvent() has already gotten it.

This illustrates another problem with the tradition of accepting events
and being unclear about what it means.  Grabbing is one thing, ending
delivery is another.

Amends a97759a336

Task-number: QTBUG-55325
Task-number: QTBUG-86729
Change-Id: I8150f901e00e7a71499fc98ab54f0ba75370f3ec
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-11-19 20:52:43 +01:00
Shawn Rutledge 423a9124e7 tst_ma::pressedCanceledOnWindowDeactivate: don't pop up second window
I guess I must have thought it would be more realistic that way;
but sending an explicit WindowDeactivate as we had it in early Qt 5
seems to keep the test passing now, and is probably more reliable.
The original purpose of the test seems to be to verify the recursive
delivery to all items via virtual QQuickItem::windowDeactivateEvent(),
which MouseArea (and no other item!) overrides to ungrab the mouse.

This mostly reverts commit 1c451b40ae.

Change-Id: I0c6f953514095a491120a0aac9944dc8b04ca17d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-11-18 23:13:48 +01:00
Volker Hilsheimer 55318c95d6 Don't copy or assign QEvent instances in tests
Copying/assigning polymorphic types is a code smell, use separate
instances instead in the tests. Those should perhaps be rewritten
to use a data driven testing approach, there's a lot of code
repetition.

In the test API implementation, first evaluate the parameters for
the event, then construct the event once with the correct values.

Change-Id: I2572772698cb0204f5ff950741b9fe3805fae15d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-11-16 10:58:52 +01:00
Alexandru Croitor 08adbefa13 CMake: Regenerate projects to use new qt_internal_ API
Modify special case locations to use the new API as well.

Task-number: QTBUG-86815
Change-Id: I3b964e3baf0cc7040830156dac30358ea1152801
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-10-06 13:19:37 +02:00
Shawn Rutledge fa6c1e408e Un-blacklist Quick tests that are passing
Task-number: QTBUG-86729
Change-Id: I35dc7ac91d2507a229dc1dde19f380e7111a4757
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-10-06 09:19:17 +02:00
Shawn Rutledge 2dfe9010c6 skip tst_QQuickMouseArea::nestedEventDelivery on macOS
It has blocked integrating anything in CI because of crashing, so
blacklisting is not enough. Does not crash locally for me on macOS 10.15

Task-number: QTBUG-86729
Change-Id: Iddae9edb09fd7b7fdadd122779832c80d0376b2d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-10-02 10:48:05 +02:00
Shawn Rutledge 92fccb0f4a Blacklist various failing tests
tst_qqflickable::nestedStopAtBounds, nestedSliderUsingTouch
tst_QQuickMouseArea::preventStealing, nestedFlickableStopAtBounds
tst_QQuickMultiPointTouchArea::inFlickable2, inFlickableWithPressDelay
tst_QQuickPathView::nestedinFlickable, touchButtonOnFlickable, touchGrabCausesMouseUngrab
tst_qqmlpropertycache::derivedGadgetMethod

Task-number: QTBUG-86729
Change-Id: Ie11a50c25f90fde2636b05a72f51640643b33dec
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-09-25 19:09:49 +02:00
Shawn Rutledge 525e4ab14b Blacklist tests due to QPointerEvent changes
qtbase/2692237bb1b0c0f50b7cc5d920eb8ab065063d47 and the associated
Qt Quick change to do direct delivery of QPointerEvents seem to have
broken a number of tests as they are currently written.  It looks bad;
however I spent a lot of time already on some older "basic" tests
like tst_qquickwindow, touchmouse, tst_qquickflickable etc. and found
a lot of things to fix while doing that; so at least those aren't broken
now.  Troubleshooting each test takes time.  Hopefully it will turn out
that many of these failures are related (there seems to be something in
common about handlers and items stealing touch grabs from each other).

Task-number: QTBUG-86729
Change-Id: I14acf57fc83fa961a25f91108dcd4aea42b54435
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-09-18 20:56:35 +02:00
YoungSun Park 3ff11ceca3 QQuickWindow: Consider z-order of children when delivering pointer events
When creating a target item list for handling pointer events, put
children after the parent item if they have negative z-order value.
This fixes an issue where an item does not receive a pointer event if
there is a child item that accepts the event even when that child item
is shown under the parent item as per the stacking order.

Fixes: QTBUG-83114
Pick-to: 5.15
Change-Id: I711faa22516f5c2396b1138dc507bcaa4ba22241
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-09-15 15:38:19 +03:00
Shawn Rutledge 192609f2f8 Fix MouseArea mouseX/mouseY coordinates while dragging
When MouseArea is not anchored with the usual anchors.fill: parent,
such that its position is not 0,0, calculating mouseX/mouseY as
d->lastScenePos - mapToScene(position()) was wrong.  It could be
d->lastScenePos - mapToScene(QPointF()), but instead we use
mapFromScene(d->lastScenePos) as in a few other places.

Amends 8068e7b98c.

Pick-to: 5.15
Fixes: QTBUG-85111
Task-number: QTBUG-75993
Change-Id: If1440d05ec3b75d9f9f4802fbc361756fadb559e
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-29 14:21:39 +02:00
Shawn Rutledge d0ae3a312a Remove QQuickPointerDevice in favor of QPointingDevice
...and generally deal with changes immediately required after adding
QInputDevice and QPointingDevice.

Also fixed a few usages of deprecated accessors that weren't taken
care of in 212c2bffbb.

Task-number: QTBUG-46412
Task-number: QTBUG-69433
Task-number: QTBUG-72167
Change-Id: I93a2643162878afa216556f10808fd92e0b20071
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2020-06-23 17:44:03 +02:00
Qt Forward Merge Bot 2812184e1b Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/qml/jsruntime/qv4executablecompilationunit.cpp
	src/qml/jsruntime/qv4executablecompilationunit_p.h
	src/qml/qml/qqmlobjectcreator.cpp
	src/qml/qml/qqmlpropertycachecreator_p.h
	src/qml/qml/qqmltypecompiler.cpp
	src/qml/qml/qqmltypedata.cpp
	tests/auto/qml/qmlformat/tst_qmlformat.cpp
	tools/qmllint/scopetree.cpp
	src/qml/qml/qqmlapplicationengine_p.h

Adjusted tools/qmllint/findunqualified.cpp to use newer API

Change-Id: Ibfb4678ca39d626d47527265e3c96e43313873d4
2020-04-09 10:08:41 +02:00
Frederik Gladhorn d28792c46d Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I2193fb62d998f130c33adda340b0da45f7b418fb
2020-04-01 07:16:05 +02:00
Frederik Gladhorn 8ace780b5a Fix QQuickMouseArea getting stuck in pressed state when hiding in press
In 78c1fcbc49 we stopped giving the
exclusive grab to hidden or disabled items with is good. But the change
did not take into consideration how mouse area handles its internal
state.

As a simple example: A mouse area that would set itself hiddin in the
press handler, would continue to have d->pressed == true, which means it
would not react to any future press events.

The fix is to let mouse area check in its change handler whether it has
become invisible.
The test also checks that enabled behaves the same way. There is no
action needed, since mouse area does completely custom handling of
enabled (maybe something to fix in Qt 6), disabling a mouse area doesn't
disable its children for example, it doesn't invoke
QQuickItem::setEnabled at all. Due to this circumventing the common
behavior, by chance disabling a mouse area in the on pressed handler
works.

Fixes: QTBUG-74987
Change-Id: Idb8499b3e5bcb744fbba203fdea5c46695bd5077
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2020-03-31 15:25:07 +02:00
Qt Forward Merge Bot 1eef06e64f Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I6f320ea43b5837444226228c118e57c4bda8702a
2020-03-20 01:00:59 +01:00
Allan Sandfeld Jensen 056016a1d8 Fix copy-pasted typo minimimal -> minimal
Change-Id: I4afef3fdbb9e3c3ec20ba5d00307992131b9ba3e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-03-18 22:03:50 +01:00
Tor Arne Vestbø a5df29201f CMake: Update Apple platform defines after rename in qtbase
Change-Id: Ia0a075e3199eab735f9b289873beeb8730ebc47e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-03-17 10:42:00 +01:00
Alexandru Croitor 26c5243491 Merge remote-tracking branch 'origin/dev' into wip/cmake
Conflicts:
	dependencies.yaml
	src/qml/qml/qqmlengine.cpp

Change-Id: I6a73fd1064286f4a2232de85c2ce7f80452d4641
2020-03-12 15:03:03 +01:00
Qt Forward Merge Bot f6808f89a8 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	tests/auto/quick/qquickmousearea/BLACKLIST

Change-Id: I3de2c6377d57f5f9204d2cfc688d50a7a0b4150c
2020-02-21 09:00:37 +01:00