Commit Graph

29270 Commits

Author SHA1 Message Date
Fawzi Mohamed d1f70a5326 qqmljslexer: add dump to qDebug
Change-Id: I8ce66f5d7a75ae8ba8733ddb464c2198bd18ce27
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-08-30 18:53:01 +02:00
Fabian Kosmale af5f853413 Transition: properly remove QPropery based bindings
We need to use QQmlAnyBinding::removeBindingFrom instead of the
functionality in QQmlPropertyPrivate, as the latter does not correctly
handle QProperty based bindings.

Fixes: QTBUG-105535
Pick-to: 6.4 6.3 6.2
Change-Id: Ifcd8d3a97ff6d62b365008768e6bf50cfa102a39
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-08-30 18:53:01 +02:00
Richard Moe Gustavsen cb5a7529ca TreeViewDelegate: fix license headers
Pick-to: 6.4
Change-Id: I8e71c13871086c5338a138a9e5d626ca458eb12f
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2022-08-30 18:53:01 +02:00
Ulf Hermann 0a8fe228f6 QmlCompiler: Prevent lookup of value type where we need an object type
With a particular nefarious combination of Q_GADGET and inheritance from
QObject you can make QmlCompiler believe a type is a value type even
though it is actually an object type. We never want to touch such a
thing.

There was a safe guard against this when looking up the type from the
scope, but by putting it in a type namespace you could circumvent it.
Refactor the code to apply to both cases the same way.

Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-104556
Fixes: QTBUG-105608
Change-Id: I8a690e2b6f78fcaba0911a93504cde0d2c7dde0d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-08-30 18:53:01 +02:00
Ulf Hermann b50d01891b Parser: Preserve keywordiness of "static" across nested classes
"static" is a keyword in the context of JS classes, no matter how deeply
nested. Therefore, keep track of the nesting level.

Switching the keywordiness of "static" off during method definition
parsing makes no sense as the standard doesn't mention such a thing.
Method bodies are strict code where you cannot use "static" as
identifier. Methods and properties can be called "static" no matter if
static is a keyword or not.

Pick-to: 6.4
Fixes: QTBUG-96631
Change-Id: Ia09e52fe2ae72721fe1c8a9b95899a31095db988
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-08-30 18:53:01 +02:00
Qt Submodule Update Bot f7da582384 Update dependencies on 'dev' in qt/qtdeclarative
Change-Id: I3da47d4dbf4499ccbe958034ba43813177ed0e3c
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2022-08-30 16:53:01 +00:00
Thiago Macieira bbbb3e49ef QQmlPropertyCache: adapt to QMetaObject revision 11
See qtbase@d2e9d70ec1f5e09bbd2fe6ea0ab94724ef9275bf

Change-Id: Ic6547f8247454b47baa8fffd170eaf4a8b4fbfdf
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-08-30 13:53:01 -03:00
Shawn Rutledge 42848bda5c Fix TextInput and TextField mouse/touch selection fallback behavior
We tried to make default behavior depend on the import version; but in
Controls that does not work well, because the QQuickTextField instance
is created in a style-specific QML file that does not use the same
import version that the user is using. So we work around it by adding
support for a Controls-specific env var to revert to pre-6.4 behavior.

Adding the autotest proves that the fallback was broken a different
way too: we didn't check selectByTouchDrag in all the necessary places.

Amends 650342de79

[ChangeLog][Controls][TextField] The selectByMouse property is now
enabled by default, but no longer enables selecting by dragging your
finger across text on a touchscreen. Platforms that are optimized for
touchscreens normally use special text-selection handles, which interact
with Qt via QInputMethod.  You can opt out of the behavior change by
setting the environment variable
QT_QUICK_CONTROLS_TEXT_SELECTION_BEHAVIOR=old.

Task-number: QTBUG-10684
Task-number: QTBUG-38934
Task-number: QTBUG-101205
Pick-to: 6.4
Change-Id: If1c1d6bd9c538f52022ae06d5252d178a1ae5a38
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2022-08-30 10:51:48 +00:00
Eskil Abrahamsen Blomfeldt 286ca997d1 Fix thread issue in TextEdit when font db updates
This amends 2fb43a35df, which
introduced invalidation of text when the font database changes.

The text invalidation is done from the render thread, which
mostly works well because it is done during sync, so the main
thread is locked. However, for TextEdit, the invalidation is
more complex and would implicitly call documentChanged() which
would then try to stop a timer. Since the timer has to be
stopped from the owner thread, it would fail and throw a
warning.

So for TextEdit, we invoke the method on the main thread
instead, which means it will use one extra update pass
in order to properly invalidate its contents.

Pick-to: 6.4
Fixes: QTBUG-105992
Change-Id: Idc020c682dcb2d1f3c66d043cf98fe9c6e4dc2a1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-08-30 12:43:29 +02:00
Ulf Hermann 7910426730 V4: Inline some PropertyAttribute storage
As PropertyAttribute is only one byte long, we can fit 4 or 8 of them
into the space the pointer needs. Doing so avoids some allocations.

Change-Id: Icea975d51d16eca7d4ace74c5763ea261b0bb8ea
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-08-30 12:40:28 +02:00
Ulf Hermann 4c3098ab10 V4: Do not update proto usage before engine is fully initialized
Updating the prototype usage is very expensive. We only need to do it
once there are lookups. Before the engine is fully initialized there are
no lookups.

Change-Id: Ic919a1f8955718d417e7747ea72e009d443c42fd
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-08-30 12:40:23 +02:00
Ulf Hermann d183606126 Doc: Fix builtin value type documentation
date was miscategorized, and variant and void were missing. list was
confusing.

Pick-to: 6.4
Fixes: QTBUG-96779
Change-Id: I8398a1a4ff7f0dff12b626d5a2a7d182e1386bcb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-08-30 12:40:05 +02:00
Doris Verria f66d0bfebe tst_qquickmenu: Take into account menu margins when checking coordinates
Pick-to: 6.2 6.3 6.4
Change-Id: I416de281882a2ad94d03567d12dbb1491ffa801c
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-08-30 08:37:29 +02:00
Doris Verria 375280f4e7 iOS style: Fix target name when linking to UIKit
Pick-to: 6.4
Change-Id: I57e28b94b3795102cf2cb4e899102106cb47b145
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-08-30 01:00:19 +02:00
Joerg Bornemann a0054754a8 CMake: Move internal targets to the QtInternalTargets FOLDER
Set the FOLDER property on targets that are for internal use only.  This
only has an effect if USE_FOLDERS is ON and the CMake generator supports
folders.

Task-number: QTBUG-99808
Change-Id: Ia86aeb328d6e31402047d7132e5e628334593801
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-08-30 01:00:19 +02:00
Heikki Halmet 6186f7109a Blacklist tst_QQuickMultiPointTouchArea::nonOverlapping and nested
nonOverlapping for Ubuntu 22.04
nested for Ubuntu 22.04

Task-number: QTBUG-101499
Pick-to: 6.4 6.3 6.2
Change-Id: I28e8a4f61c9bb1a5e0b2185e88dff22fbf170e37
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-08-29 18:48:09 +00:00
Ivan Solovev 309e2e864f QtDeclarative: port away from deprecated qSetGlobalQHashSeed(0)
Use QHashSeed::setDeterministicGlobalSeed() instead

Task-number: QTBUG-105102
Change-Id: I1d13f3872b335ff9998f7c4538d3b9c3c77fe232
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-29 20:48:09 +02:00
Doris Verria f9205f3918 iOS Style: Draw progress for indeterminate progressbar
Ammends commit 4a6e7cec99
which made the progress visible only when value was bigger
than 0, but didn't take into account the indeterminate status.
In the indeterminate status, the value is 0 but we still need to
draw the progress.

Pick-to: 6.4
Task-number: QTBUG-105937
Change-Id: Idd313716a65fd5004524de8ac8ce5ecd59d3e599
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2022-08-29 18:48:09 +00:00
Doris Verria b1c90719fe iOS Style: Add Menu controls
Add Menu, MenuItem, and MenuSeparator.

Pick-to: 6.4
Change-Id: Ic5d6629418081e591c1abd28cea73b6c3b3ecd1c
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2022-08-29 20:48:09 +02:00
Shawn Rutledge 3ebb3540df TextArea: selectByMouse default=true, but not on touchscreens
When you drag a finger across a TextArea, it should not select text.
- your finger probably covers several characters, so you can't see where
  you're selecting until afterwards
- if the item is in a Flickable, flicking by touch should be prioritized
- if flicking happens, the text cursor should not move; but to avoid
  losing too much functionality, we allow it to move on release, if
  the TextArea gets the release (i.e. if it still has the exclusive
  grab)
- TextArea's pressed, pressAndHold and released signals continue to
  behave the same with touch as with mouse

As with the TextEdit change in 90d3fac73a,
we now distinguish mouse events that are synthesized from non-mouse
devices and avoid mouse-like behaviors as described above, but there is
no behavior change if the event comes from an actual mouse or touchpad.

In QQuickPressHandler::mousePressEvent() we give the original event's
device to the delayed press event, now that we check the device to
distinguish "real" mouse events from those that are synthesized from
touch.

[ChangeLog][Controls][TextArea] The selectByMouse property is now
enabled by default, but no longer enables selecting by dragging your
finger across text on a touchscreen. Platforms that are optimized for
touchscreens normally use special text-selection handles, which interact
with Qt via QInputMethod. You can opt out of the behavior change by
setting the environment variable
QT_QUICK_CONTROLS_TEXT_SELECTION_BEHAVIOR=old.

Pick-to: 6.4
Task-number: QTBUG-10684
Task-number: QTBUG-38934
Task-number: QTBUG-90494
Task-number: QTBUG-101205
Change-Id: Icbe81e547b1cf8d5e3cc3ed922f12c7b411ca658
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-08-29 20:48:07 +02:00
Richard Moe Gustavsen b25a80b61f QQuickTreeViewDelegate: ensure we call the correct base functions
QQuickTreeViewDelegate no longer inherits QQuickAbstractButton
directly, but QItemDelegate.

Pick-to: 6.4
Change-Id: I0006d04275894d4c0be9406ec4fc5612344c2e51
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2022-08-29 13:59:44 +02:00
Shawn Rutledge 71bb0b4b1a Deprecate Qt.labs.platform.StandardPaths
It's been available in the QtCore module since 6.2.

Pick-to: 6.4
Task-number: QTBUG-92806
Change-Id: I4da346823bd29f73c039e13aabd31f2274049974
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2022-08-29 13:30:37 +02:00
Ulf Hermann a22bd4164e Doc: Document behavior of remote implicit imports
They are remote directory imports for all practical purposes. Therefore,
you need to add qmldir files to make them work.

Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-92068
Change-Id: I7b11e55e53b2c96d95619ac2346cd45561e73b9a
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-08-29 13:21:40 +02:00
Ulf Hermann 3cd0000b70 Doc: Connections: Mention old syntax and its problems
In particular, you cannot mix old and new syntax in the same object.

Pick-to: 6.2 6.4
Fixes: QTBUG-93603
Change-Id: I27cb0a925baafa68715d9a5e2c505d963b4a390f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-08-29 11:21:34 +00:00
Ulf Hermann 11da5cdcb0 QmlCompiler: Avoid unnecessary copies in loops
Coverity-Id: 397268
Coverity-Id: 397269
Change-Id: Iacbf6c8a57dbdee02e75f4faeed0a0f31d37500f
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-08-29 13:21:13 +02:00
Ulf Hermann f4577447a1 QmlCompiler: Implement remaining operators
Some of the math operators were still missing. Add them and test them
all.

Since the "runInterpreted()" test function takes too long now, split the
qmlcppcodegen test in two: One that runs in compiled mode and one that
runs in interpreted mode.

Fixes: QTBUG-105188
Change-Id: I4b641d5e51b5a7e2a9254be40f257d7b249deb13
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-08-29 13:21:06 +02:00
Ulf Hermann cad5c89a0f QmlModels: Fix enum resolution in ListElement
There were two problems:
a, We need to allow recursion when querying for enums. Otherwise we
   cannot find enums in the same document.
b, when the enum resolution is done in the validation phase, we cannot
   query the current document's QQmlType for enums, yet, as it's not
   finalized. However, the QQmlPropertyValidator has the
   QQmlPropertyCache we're looking for in that case.
c, As a drive-by, fix the excessive conversions between QByteArray and
   QString.

Pick-to: 6.4
Fixes: QTBUG-95864
Change-Id: If0d2687986e1483a27ce11373a204235b92a6efd
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-08-29 13:20:53 +02:00
Ulf Hermann d937a53cbc qmlimportscanner: Don't crash on invalid argument
Apparently you can pass one "root path" as a bare argument, but you have
to specify "-rootPath" if you want to pass more than one. The whole
concept of a "root path" is wrong. Therefore let's not add more ways to
specify root paths. It should not crash, though.

Pick-to: 6.4
Fixes: QTBUG-104928
Change-Id: Ie8a10ac7208f927fdb1fed0f87c088739b41c983
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-08-29 13:20:41 +02:00
Ulf Hermann ef8cd39b28 qmltyperegistrar: Fix file inclusion and writing to stdout
Apparently if you write #include into a raw string literal, the file is
included right there, as part of the string. We don't want this.
Therefore, write the #include as regular string.

Furthermore, drop some dead code, and make sure we actually write to
stdout if no -o option is given.

Amends commit dbe42f6435.

Change-Id: Ia4074dd486bdf9430acec4ac2564f9e654b5e3a8
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-08-29 13:20:35 +02:00
Ulf Hermann cc89f62851 qmllint: Don't warn about access to attached enums
You can always access enums of attached objects, no matter what other
rules apply to the attached properties.

Pick-to: 6.4
Fixes: QTBUG-105590
Change-Id: I07878d8efe63468539168aa2c2842e3159ed2090
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-08-29 13:20:28 +02:00
Joerg Bornemann 88aef52989 CMake: Place *_qmllint* targets into a separate FOLDER
Set the FOLDER property to *_qmllint* targets to the value of the newly
introduced global property QT_QMLLINTER_TARGETS_FOLDER.  The default
folder name is "QmlLinter".

This only has an effect if USE_FOLDERS is ON and the CMake generator
supports folders.

The all_qmllint is not moved into the QmlLinter folder, because users
might want to trigger it manually.

[ChangeLog][CMake] Introduced the QT_QMLLINTER_TARGETS_FOLDER global
property to specify the name of the FOLDER for qmllint-related targets.

Task-number: QTBUG-99808
Change-Id: I2b89afdeab386507f7c2db17aa011a3b0535f2b4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-08-29 08:11:15 +02:00
Johannes Kauffmann abfd75e98f Avoid both virtual and override on destructors
Destructors don't need to be declared virtual when the destructor from
the parent class is already declared virtual.

Additionally, this removes the last usage of Q_DECL_OVERRIDE.

Pick-to: 6.4
Change-Id: I7d43f5d5fbb1423319adde04d4994ada9daab6b1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-08-28 16:51:21 +00:00
Oliver Eftevaag 5647527a8c Flickable: let changing contentItem pos also affect the drag starting pos
When calling the setContentX(qreal) and setContentY(qreal) functions,
the flickable would not update the drag starting position if they were
called in the middle of a dragging operation.

This patch makes those function update the drag starting position, so
that the drag will take into account the external changes to the
contentItem position, and not make any massive leaps on the next call to
drag() after changing the contentItem position directly.

Note that vData.pressPos and hData.pressPos are set to the x and y
position of the contentItem at the beginning of a drag operation.
They are unrelated to the mouse position.

The bug QTBUG-104966 will be fixed from this, since QQuickItemView::setModel() calls
QQuickListViewPrivate::setPosition() which calls
QQuickFlickable::setContentX/Y().

The QQuickFlickable::setContentX/Y functions are public (part of the public
API). They will update the timeline value for the x and y axis, which
will as a result also call setViewportX/Y, which calls setX/Y for the
contentItem itself.

Done-with: Jan Arve Sæther <jan-arve.saether@qt.io>
Fixes: QTBUG-104966
Pick-to: 6.2 6.3 6.4 5.15
Change-Id: Id5165e1ff37a07b94be8c1cc152e86dfcc13d1c6
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2022-08-27 00:31:21 +02:00
Allan Sandfeld Jensen 69d61fecf2 Fix non-OpenGL usage of QQuickWidget::setContent(QUrl(), nullptr, root)
We should not delete the user given root, but ensure it is reparented.

Change-Id: I91dc57482ffa7f7faa91b70016c6369c8dc950ab
Pick-to: 6.4
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-08-26 18:32:19 +02:00
Jan Arve Sæther 9a4874ab7f StackLayout: Do not set size of children to (-1, -1)
The item-size-hint-cache in StackLayout was not always valid when
QQuickStackLayout::rearrange() was entered, so it would end up setting
the size of the item to (-1, -1)

Pick-to: 5.15 6.2 6.3 6.4
Fixes: QTBUG-105899
Change-Id: I632aa18bb10b84d59af35cd3c7cb0c675d8d1692
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2022-08-26 13:37:12 +02:00
Mitch Curtis 25bd3b526c Doc: fix and improve FileDialog example snippet
Replace it with a self-contained example that can be copy-pasted and
run, and that is easier to understand.

Pick-to: 6.3 6.4
Change-Id: I54b67b0173d25aee509318ff842bb895c7244a48
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-08-26 19:36:54 +08:00
Oliver Eftevaag af34e238b8 Doc: fix typo in QQuickAccessible
Fixes: QTBUG-105812
Pick-to: 6.2 6.3 6.4
Change-Id: I735b23999a87bead759ea7987975c3d4cefdebf8
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-08-26 13:36:31 +02:00
Ivan Solovev a83f4bc19d Tests: do not use QT_DISABLE_DEPRECATED_BEFORE
For several reasons:
* It was renamed to QT_DISABLE_DEPRECATED_UP_TO
* Its value will be propagated from the general Qt build

Task-number: QTBUG-104858
Change-Id: I90c92dc05b884f6408467c573181c00f8e00e6b3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-08-26 12:49:40 +02:00
Ivan Solovev a56a90d110 tst_qquickdraghandler: guard the usage of deprecated APIs
Protect the usage of deprecated APIs by #ifdefery, and also suppress
the deprecation warnings for it. Add tests for the replacement APIs.

In tst_multipointtoucharea_interop simply replace the deprecated
API with the new one.

This allows to build the tests without deprecated APIs.

Task-number: QTBUG-104858
Change-Id: I017e64ca467455decd6c663240225de69acebec1
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-08-26 12:49:37 +02:00
Ivan Solovev 4089ce1bc5 QML tests: port away from deprecated QLocale::nativeCountryName()
... and use nativeTerritoryName() instead.
This allows to build the tests without deprecated APIs.

Task-number: QTBUG-104858
Change-Id: Ia66f2e05fd033e1ca6da93b58dbcbccae3448ec5
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2022-08-26 12:49:33 +02:00
Ivan Solovev 7e149a310d tst_qqmlengine: guard the usage of deprecated APIs
Protect the usage of deprecated APIs by #ifdefery, and
also suppress the deprecation warnings for it.
This allows to build the tests without deprecated APIs.

Task-number: QTBUG-104858
Change-Id: Ied0aecc3fdf07db436ac11e70d0fa78e6a96dc1d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-08-26 12:49:29 +02:00
Seokha Ko 3c3aef1486 Use the time stamp of the touch event when deliver touch as mouse
Use the time stamp of the touch event when converting a touch event
to a mouse event for items that do not handle touch events

Fixes: QTBUG-105907
Pick-to: 6.2 6.3 6.4
Change-Id: I642093346459a031b77174eeecba8470e103e8dc
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-08-26 12:07:31 +09:00
Benjamin Terrier b201b1d0b3 Fix error when calling byteLength on detached ArrayBuffer
ArrayBuffer constructed from en empty QByteArray are detached,
calling byteLength should not throw an error.

According to ECMA specifications the `byteLength` property
of a detached ArrayBuffer should retrurn 0.

See https://tc39.es/ecma262/multipage/structured-data.html#sec-get-arraybuffer.prototype.bytelength

[ChangeLog][QtQml][Important Behavior Changes] ArrayBuffer.byteLength()
now returns 0 on detached ArrayBuffers, conforming to ECMAScript 2021.

Fixes: QTBUG-103925
Change-Id: Ib1c325eff25459980e10a1f3cd9fb7cb3b8eb5e5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-08-25 23:57:11 +00:00
Shawn Rutledge 79893e1773 Ensure that multiple HoverHandlers can react to multiple device types
1c44804600 had some known incompleteness in
QQuickItemPrivate::effectiveCursorHandler because it couldn't be
finished in Qt 5; but HoverHandlers with different acceptedDevices and
acceptedPointerTypes were working together in Qt 6.0 and  6.1 to an
extent. Perhaps for this case it helped that HoverHandlers got passive
grabs, but we stopped that in bbcc2657fa.
So now, as with mouse events, we need to ensure that when a HoverHandler
detects a particular stylus device in a QTabletEvent and chooses a
different cursor, it is applied to the window.

At this time, since QQuickDeliveryAgentPrivate::deliverHoverEvent()
sends a synth-mouse event, it's not suitable for tablet hover; so we
depend on correct implementation of allPointsGrabbed() to ensure that
QQuickDeliveryAgentPrivate::deliverUpdatedPoints() will visit all the
HoverHandlers, in this case only.

Pick-to: 6.3 6.4
Fixes: QTBUG-101932
Change-Id: Ia8f31610e9252825afc7151be58765ac5217b0e8
Reviewed-by: Doris Verria <doris.verria@qt.io>
2022-08-25 23:57:11 +00:00
Shawn Rutledge 68dc224920 Allow implicit mouse grab by accepting only on press
If we install a DragHandler on a Controls Button and try to drag it:
on press, the DragHandler takes a passive grab, and the Button accepts
the event, which gives it an implicit exclusive grab. Then when we drag
past the drag threshold, the DragHandler takes over the exclusive grab;
but we also deliver the mouse move to the Button, because it already had
the exclusive grab before. It doesn't ignore() the event, but we do not
want to interpret the accepted state as a reason for the Button to
re-grab the mouse, because it's just a move, not a press. This should
restore the behavior to what we had in Qt 5.

Pick-to: 6.4
Task-number: QTBUG-105610
Change-Id: I77e185b2737da19848e206cf08fc62cf62930d92
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-08-26 01:57:11 +02:00
Laszlo Agocs fc088c4d5a scenegraph docs: Mention a way to enable Metal validation
Change-Id: I07e69b8456c3e5ae5f4c364874d69781491e10fa
Pick-to: 6.4
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-08-25 22:47:55 +02:00
Shawn Rutledge b271755e6c Fix bad rendering after text selection
In 9db23e0e04 we added a new call to
createTextNode(), but it turns out that it could be called again for the
same block, a few lines below (in code that was originally added in
dfdc4ce825), if we have not reached the
"last node that needed replacing or last block of the frame". This
resulted in a memory leak: TransformNodes were created without parents,
which b616028dae tried to fix by calling
addCurrentTextNodeToRoot(). That change made the code in "Update the
position of the subsequent text blocks" re-add offsets that had already
been added, which had the effect of moving down the blocks below the
selected ones by the height of one line; but the new call to
addCurrentTextNodeToRoot() was anyway just adding empty TransformNode
instances to the scene graph. Afterwards we can see that any
TransformNode that does not have a GeometryNode as a child is not
actually rendering any text, it's just wasting memory. Having a debug
operator for QQuickTextEditPrivate::Node, and using a QQuickTextEdit
subclass in the autotest that checks the nodes corresponding to blocks
rendered at the end of updatePaintNode(), makes this easier to see
and verify.

So now, if createTextNode() has already been called, we avoid calling
it again a few lines below; but we keep the checks in place to make
sure that every node which does not have a parent will get added to
the scene graph (regardless of which line of code it was created on),
so that there's no leak.

It remains to be seen if this could be cleaned up further.

Amends 9db23e0e04 and
b616028dae

Pick-to: 6.3.2 6.3 6.4
Task-number: QTBUG-103819
Fixes: QTBUG-105208
Fixes: QTBUG-105555
Fixes: QTBUG-105728
Change-Id: I321980c705887bfdb37825f7e6ed8da3d200654e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-08-25 19:34:08 +02:00
Ulf Hermann 47490648b1 QmlTest: Prevent interleaved execution of TestCases
Run all TestCase instances on a timer in a singleton. This way, even if
one TestCase manages to trigger a different one while it's still
running, the new TestCase won't be executed until the old one is
finished.

Fixes: QTBUG-98350
Change-Id: I1797b5487f2c70fd2edfdbf8cf4c43a6353b12c8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-08-25 19:05:51 +02:00
Sami Shalayel 75769767ac qmltc: translation binding support
Implement and test support for translation bindings in qmltc:
* qsTr()
* QT_TR_NOOP()
* qsTrId()
* QT_TRID_NOOP()

Not compiled by qmltc, but instead interpreted as script bindings:
* combinations like qsTr(qsTr())
* qsTranslate() (as in qmlsc)
* QT_TRANSLATE_NOOP() (as in qmlsc)

Add the *.qm files directly to the resources as qt_add_translations() is
not available from qtdeclarative (the cmake function lives in qttools that
depends on qtdeclarative).

Fixes: QTBUG-104637
Task-Id: QTBUG-105346
Change-Id: Ia9433c2bcef01f3486358d963059d9779c67708c
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-08-25 11:35:57 +02:00
Paul Wicking e3aeb13052 Doc: Drop duplicated word
Pick-to: 6.4 6.3 6.2
Change-Id: Ie1814aa6d990e1caecf0a92d983d8260c48669ec
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-08-25 07:15:42 +02:00