The event filter was returning true when wheelEnabled was false,
but wasn't ignoring the event, meaning that propagation of the wheel
event stopped there, and items behind the ScrollView didn't get the
event even if ScrollView wasn't using it.
I'm not sure why it was done this way - the behavior isn't documented
and no auto tests fail when changing it.
Fixes: QTBUG-105164
Pick-to: 6.3 6.4
Change-Id: Ie826ccfc406b77606ef0c6f043dc48f42a18cdc7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
anchors is only registered as an anonymous tpye, and the backing C++
type is only available via a private header.
Thus, it is impossible for users to have a type derived from anchors,
which might cause shadowing issues when the properties become FINAL.
Consequently, we can safely mark all properties as FINAL.
Pick-to: 6.4
Fixes: QTBUG-104749
Change-Id: Iabb2f2a943ed473a7b25e04dd4c6a928af0cd79b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
The warning was:
pinchproperties.qml:45:13 Parameter "pinch" is not declared. Injection
of parameters into signal handlers is deprecated. Use JavaScript
functions with formal parameters instead.
Pick-to: 6.2 6.3 6.4
Change-Id: Iac453ae128cd4ac4b621d9548f439a121f83c407
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
You cannot actually remove anything from these hashes.
Change-Id: I4b08639f56e3198f48dac1fabfd324cca87c3fdc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Fix subtle issue where alias assignment would cause qmltc to generate
direct property set code (doesn't work for aliases since those do not
have "real" properties)
Remove now redundant TODO and identical code path when compiling alias
assignments on types with composite bases (used to work poorly during
prototype times)
Pick-to: 6.4
Change-Id: Ifacf5872ff5432a748fb1ec16c300ec844d65e9a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
We already generate the Q_UNUSED() for input arguments when compiling
the common part of endInit (in QmltcCodeGenerator), no need to repeat
it elsewhere
Pick-to: 6.4
Change-Id: I2c33389ff6f1c2063db80586425b260c764905f4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
- SKIP instead of blacklist the popup test on macOS as the cursor
position can't be controlled on this platform.
- Use the TRY variant with isOpened() instead of isVisible() in order
to make sure that all enter/exit transitions are finished before
interacting with the menu. Otherwise, the test can be flaky.
- The subMenuDisabledMouse test expects currentIndex to be set on
mainMenu when the click happens. As we set the currentIndex on a
hover or keyboard navigation event, explicitly generate a hover event
with mouseMove before clicking.
Pick-to: 6.2 6.3 6.4
Change-Id: I7eba20a6b25f2e48a66145774539523def7142e6
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The qmlqtimeexampleplugin exists as a target name both in examples and
in a test; rename the one from the test.
Change-Id: I21b68f7d6228ceaee49ba28e55516b5b10ffce3a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
testlib's VERIFY and COMPARE macros only work in the function directly
invoked by the test framework.
Temporarily use a copy of the upcoming QTEST_CHECKED marco from testlib
to check that the indirectly called functions actually behaved
currently.
Moreover, move the call to the clean function into a scope guard, so
that it also will be called when the callback returns early due to
failed testlib change – otherwise, we'll end up waiting until the
timeout in QTRY_COMPARE_WITH_TIMEOUT.
Pick-to: 6.4
Change-Id: I371c021f55f11e32950b12a57cf52ad0edb1fd7b
Reviewed-by: Moody Liu <mooodyhunter@outlook.com>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
So far we have only accepted QQmlListReference. However, we can also
pass a QQmlListProperty around as value.
Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-105137
Change-Id: I7d4cd3048b62594298f91013c4cda5ec864a28df
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Apple clang says:
error: loop variable 'kv' is always a copy because the range of type
'QtPrivate::QKeyValueRange<const QHash...> &>'
does not return a reference [-Werror,-Wrange-loop-analysis]
Change-Id: I4dc43805d3d3f723e5ec8cc504969cda3d99fb43
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Instead of exposing a QQmlV4Function* overload, we can expose an
overload set to the engine. We do not gain anything from using
QQmlV4Function*, as we otherwise would need to manually parse the
arguments we got and dispatch to the correct internal function.
Unfortunately, we can only deprecate the QQmlV4Function* overload, not
outright remove it: While no public API allows creating a
QQmlV4Function* object, and passing a null pointer would lead to an
immediate crash, it is possible to write a Q_INVOKBALE that forwards its
argument to one of the existing functions. That could then be used in
QML. Thus, we can only deprecate the function in Qt 6.
We make the new overloads public to ensure that the methods get found by
the engine even after the engine ignores private invkoables (compare
QTBUG-105136).
Task-number: QTBUG-105139
Change-Id: I6af2c69f4bd2b70ae45936138808313421085b01
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Fix subtle issue where an import namespace would become part of the
generated C++ class name without modifications (so with '.'). Preserve
the namespace for the time being just to make the generated code more
verbose (e.g. consider mixing QQ.Text and ZZ.Text in the same file)
Change-Id: I3d409988ae136c272aac6a4eab287a7221f88450
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Instead of doing build file path to source file path mapping for each
QML file, we could store qml module prefix to qml module output
directory mapping instead. This reduces the produced qrc size and makes
it more convenient to work with
Do a clean separation at the QQmlJSImporter level to prevent using
resource file mapper for build directory path resolution
Amends 7f567e6a42
Change-Id: If984abada1d39c386af5712af778eb29956e0537
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
qmltc needs to compute a QMetaProperty index ahead of time when creating
property bindings. This procedure has to acknowledge that extensions
exist
Change-Id: I7bf6b6c558ce78e0fec5ee880bc4d39a79fe5640
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Use QTRY_VERIFY2 to show the actual contentY upon failure.
Task-number: QTBUG-105190
Pick-to: 6.2 6.3 6.4
Change-Id: I387d92cbc33e2aab67f72219f3354adbd537c334
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This was accidentally left in
as part of e987d60297.
Pick-to: 6.2 6.3 6.4
Change-Id: I918aaf18a80d8460a357a2d097f02ee9917e33d5
Reviewed-by: Doris Verria <doris.verria@qt.io>
... when compiling with QT_DISABLE_DEPRECATED_BEFORE >= 0x060300.
This warning is treated as error in some configs, so simply use
Q_UNUSED() on the variable.
Task-number: QTBUG-104950
Pick-to: 6.4 6.3
Change-Id: Id5d06ea8fb0a89cc28a8519b443f8272b4417aa5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
In case of a JS context, we need to do the JS lookup early in order to
override imports with locally defined functions.
[ChangeLog][QtQml][Important Behavior Changes] The precedence between
imports and locally defined functions and variables in JavaScript files
has been fixed. If you import a JavaScript file from a QML file, the
functions inside the JavaScript file should obviously override anything
imported from the QML context. This behavior has been restored.
Pick-to: 6.4
Task-number: QTBUG-91687
Change-Id: I119e3109f96ffad7455daaf1a5f17bad31fa8e33
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Allows for linting any QML module by simply calling ${target}_qmllint_module
on it.
Change-Id: I71cbb082e28824a2b4afabdb5764b3f4c4d8eec1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This change allows for modules to be linted via the -M flag.
This will check whether an individual module has a sound qmldir and
qmltypes. It will also verify whether all its types and the types of
properties can be resolved.
It does not lint individual QML files.
[ChangeLog][qmllint][New Feature] Individual modules can now be linted
via the -M option
Fixes: QTBUG-103264
Change-Id: I3ced4b0bc05358e9216c9819f1dca67af909405e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
As detected in Creator by hjk:
Detaching the rawString_stack alone shows up at 0.85% when loading
Creator inside Creator. One write access is actually used from
qmljs.g:593, so making the whole function const would need more work.
Take a short cut and replace the unneeded reference counted container
with a non-reference counted one.
Change-Id: I480d539f532f9dbfbb0ddef986a7177dfca9b173
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Group and attached properties have QmlIR::Objects associated with them.
However, qmltc's object index calculation ignores groups/attached types.
Fix this, making object index calculation aligned for implicit
components
Fixes: QTBUG-104780
Pick-to: 6.4
Change-Id: I377d3eab714d0e9618ac2ef84c2738b45ad3b6cc
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This fixes the issue where Fusion style Buttons were displayed
by DialogButtonBox for its standardButtons.
We need to provide our own implementations of Dialog and DialogButtonBox
to ensure that the correct files get picked up.
The implementations themselves are almost identical copies of the Fusion
style's, with some imports removed.
The Fusion style is the macOS style's fallback.
Fixes: QTBUG-104658
Pick-to: 6.2 6.3 6.4
Change-Id: Ib7958565ee62f6f4286f87298ab98209e916b6b0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
When you drag a finger across a TextEdit, 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 TextEdit gets the release (i.e. if it still has the exclusive
grab)
So now we 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.
Since most users want selecting text by mouse to "just work", and an
actual mouse is precise enough to do so, and dragging a Flickable with
the mouse is unintuitive (since most UIs don't allow it and most mice
have wheels), selectByMouse now defaults to true, and has the stricter
meaning that its name implies. To select text on a touchscreen, the
end-user needs to rely on text-selection handles, which are provided on
touch-centric mobile platforms, and could also be implemented from
scratch if someone builds a custom text field using TextInput.
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][QtQuick][TextEdit] 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
using an import version < 6.4.
Pick-to: 6.4
Task-number: QTBUG-10684
Task-number: QTBUG-38934
Task-number: QTBUG-90494
Task-number: QTBUG-101205
Change-Id: Ia96f53cd7c6db5f995aab5505f61c13f9a4c4c0a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
If you import a module with a prefix, you can use its scripts as members
of that prefix.
Pick-to: 6.4
Fixes: QTBUG-104701
Change-Id: I35f79005ea793f501e782e748f7ad5badd3d75ef
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
When we write runtime functions to compilation unit at run time, the
order of the functions in the unit (often) differs from the order of
functions in the unit produced ahead of time by qmlcachegen and friends.
Additionally, the order also differs from what qmltc expects (and
qmlcompiler library in general)
Fix the order by simplifying the procedure of JS code generation when
we create the compilation unit at run time: new logic just goes over
the objects in the document linearly, instead of relying on bindings
(which are known to be out of order w.r.t. AST)
Change-Id: I4070b9d061f03c4c76d03120654ad3f30725493a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
- When clicking on the menu, take into account the menu's coordinates
as this may not always be (0,0) depending on the style-specific margins.
- Wait for the menu enter transitions to finish before trying to
interact with it, otherwise it leads to flakiness.
- Explicitly set the overlap property to 0 when testing the submenus
as the test relies on the menuItem to be clickable and not hidden by
an overlapping subMenu item.
Pick-to: 6.2 6.3 6.4
Change-Id: I561f47e69b2c9ee12c46f6accacd06e22b448df5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Set the color accordingly depending if it's a flat button or not.
Pick-to: 6.4
Change-Id: Ic015906043afeda08c5ad9a65670b89ec36057e1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Otherwise we get an out of range access when looking for the line
number. To be extra safe, we also add another guard against this to the
lineNumber() function.
Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-90466
Change-Id: I4d9cb52ecba2631696537f02a3c1b75c3658ceb8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
It needs to relate to QQmlEngineExtensionPlugin, not
QQmlExtensionPlugin which is obsolete and does not show
up in the documentation.
Pick-to: 6.2 6.3 6.4
Change-Id: Ia3f685c07040213df86dd6bc38f105929071fff3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
To increase the chance of finding it.
Pick-to: 6.2 6.3 6.4
Change-Id: Id71267e887d3799d8dc50858942d1c37557a8b82
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
If one assigns a binding whose evaluation results in a QJSValue, care
must be take to correctly convert it into a bool. Instead of directly
using QVariant::value<bool>, one needs to first extract the QJSValue,
and only convert it to bool afterwards.
This is necessary due to the custom binding evaluation we're doing to
avoid state oscillation.
Amends a8c729d839.
Fixes: QTBUG-105000
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I4b093b48edecf9e0f09d2b54d10c2ff527f24ac3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
We sometimes expose q(u)longlong to QML despite the fact you can only
pass them around in variants. Add these placeholder types to satisfy
qmllint for now until we fully support these types.
Change-Id: I4c62cee8a4cfc6015f7b76884100d4a675416571
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>