Commit Graph

20634 Commits

Author SHA1 Message Date
Maximilian Goldstein e9af4fcf54 Qt.labs.animation: Make plugin optional
This moves the animation types into a new library and is meant to make
them availabe to the QML compiler at some point in the future.

Task-number: QTBUG-90487
Change-Id: I19bd864253941931706933f7e517bb31938e9cc2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-01-21 13:26:00 +01:00
Friedemann Kleint 2fdf354c66 Silence warnings about deprecated QString::QString(const char*)
Fix warnings like:
src/qmllocalstorage/qqmllocalstorage.cpp:81:62: warning: QString::QString(const char*) is deprecated: Use fromUtf8, QStringLiteral, or QLatin1String [-Wdeprecated-declarations]
src/src/labs/settings/qqmlsettings.cpp:335:87: warning: QString::QString(const char*) is deprecated: Use fromUtf8, QStringLiteral, or QLatin1String [-Wdeprecated-declarations]
src/labs/settings/qqmlsettings.cpp:346:50: warning: QString::QString(const char*) is deprecated: Use fromUtf8, QStringLiteral, or n1String [-Wdeprecated-declarations]
src/labs/settings/qqmlsettings.cpp:361:50: warning: QString::QString(const char*) is deprecated: Use fromUtf8, QStringLiteral, or n1String [-Wdeprecated-declarations]
src/quicklayouts/qquicklayout.cpp:1241:61: warning: QString::QString(const char*) is deprecated: Use fromUtf8, QStringLiteral, or QLatin1String [-Wdeprecated-declarations]

Change-Id: I87d7e28842a4f7f75b02c1e78eb3df400adcab94
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-01-21 12:59:10 +01:00
Maximilian Goldstein eb5bb9e7f5 Qt.labs.folderlistmodel: Make plugin optional
This moves the folderlistmodel types into a new library and is meant to make
them availabe to the QML compiler at some point in the future.

Task-number: QTBUG-90487
Change-Id: Iee84a4804a241aa1dee5f896a02ccc9f0ecc0d8d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-01-21 10:35:52 +01:00
Laszlo Agocs 3fadfb2c3f Expose the list of preferred instance extensions to rendercontrol users
As all QRhi stuff is private, it needs to have a public counterpart in
Qt Quick in order to fully support the case of Vulkan-based
QQuickRenderControl usage.

Change-Id: Iaf9a7aa56022acd31af6ebf16de6b83a04966ff4
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-01-21 10:19:01 +01:00
Laszlo Agocs 6a15654000 Query QRhi's desired Vulkan instance extensions instead of hardcoding
Change-Id: I9859e1b2f786f1e578f3536bb3299c38a3a9a8b6
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-01-21 10:18:58 +01:00
Ulf Hermann 39944e8467 qmllint: Remove exceptions for most unknown builtins
All those types are properly defined in the qmltypes files now. We just
need to search the enumerations the same way as methods and properties
in order to find everything.

Also, deduplicate the code that resolves properties, methods, and enums
by using a common template for iterating the scopes.

Change-Id: I0bf1423974d0ec8f602ecd0342522b3e981a8586
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-01-21 08:45:16 +01:00
Andrei Golubev 90be89d771 Use new QObjectPrivate connection mechanism in dynamic connections
Old API assumes sender == receiver, which results in wrong handling of
connections when receiver is deleted: connection is not removed or
notified elsehow as it's not really tied to a valid receiver

Task-number: QTBUG-86368
Pick-to: 5.15 6.0
Change-Id: I0f3115f1b0f26cf353752ba2b8fd88e0f3bdd388
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-21 08:38:50 +01:00
Nico Vertriest 3c6b913123 Doc: Fix CI warnings qtdeclarative
Task-number: QTBUG-90439
Change-Id: I24664b27c3185c595b1ffd994cdf51b944f494ee
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-01-21 06:06:50 +01:00
Qt Submodule Update Bot 396d7f83b6 Update dependencies on 'dev' in qt/qtdeclarative
Change-Id: I8a044533c9ae8637c6bc348d06f38ca105a5c9d0
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2021-01-21 05:33:36 +02:00
Ulf Hermann 05b1cbb68b Doc: Change section about writing a qmltypes file
You should not write qmltypes files manually. We only document their
existence and that you should add them to manually written qmldir files
now.

Change-Id: I434398656179806c3e57724324aba38738384e1d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-01-20 18:45:23 +01:00
Ulf Hermann 5f0ea7263f QQmlJSScope: Fix typo
Change-Id: Idb29a7483b813ed00849c13ef1324c7e931400de
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-01-20 18:41:39 +01:00
Maximilian Goldstein 0fb373c9a2 Qt.labs.settings: Make plugin optional
This moves the settings types into a new library and is meant to make
them availabe to the QML compiler at some point in the future.

Task-number: QTBUG-90487
Change-Id: I986615b08ea8c1a7312b9d9c6ae0b13c03fb5497
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-01-20 17:28:10 +01:00
Richard Moe Gustavsen a738c35667 Ensure we cancel touchMouseSynthesis upon receiving touchCancel
As it stood, we wouldn't cancel touchMouseSynthesis after
receiving a touch cancel event. The result would be that
the first touch event sent to QQuickWindow thereafter would
have touchMouseId set to value different from -1. This
again would fool QQuickWindow into believing that the
event belonged to a touch event it has synthesized
before, and it would as such take a different/wrong path
for delivery.

This caused text selection to fail on iOS, since a
press-and-hold on a line edit from QPA would cancel
the touch event and show a magnifier glass. When the
user later touched inside the line edit again to
move the cursor, this new touch event would not be
delivered to the text edit.

Pick-to: 6.0
Fixes: QTBUG-90485
Change-Id: Iad640ae57317ea86ee68ca053654b0b30ade003a
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-01-20 17:00:34 +01:00
Fabian Kosmale 3230caeeb5 Restore libfuzzer pro files
This is a partial revert of 78ab4b8d8b, as
the fuzzing infrastructure has not been migrated to CMake yet.

Change-Id: Iebd873ec3760c5394bc248ed853b57e168d0f05c
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2021-01-20 15:23:08 +01:00
Maximilian Goldstein fb6158732b QtQuick.LocalStorage: Make plugin optional
This moves the LocalStorage types into a new library and is meant to make
them availabe to the QML compiler at some point in the future.

Task-number: QTBUG-90487
Change-Id: I57ae8dc45a9ef3d5221520f656a2475bca2eb453
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-01-20 15:20:52 +01:00
Ulf Hermann 2506938d82 QmlCompiler: Add equality operators and hash functions
We want to be able to use these types in hashes.

Change-Id: Iea60bb8dd1ce893a37c4856d153f0f5c77d29fcd
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-01-20 13:34:01 +01:00
Ulf Hermann 3ae2a6a47c qmllint: Support extended types
Fixes: QTBUG-90448
Change-Id: I5fb6b3d9223ae95ca7e039c5b9139ed086052c29
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-01-20 13:33:52 +01:00
Maximilian Goldstein bf573ad295 QML_SINGLETON: Handle local create() functions with foreign types
Previously only the foreign type was searched for a create method.
Now the wrapping type can also contain it.

Change-Id: I05fb9e0c0a54c14530eb9adcae5a44df5c208be3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-20 12:07:34 +01:00
Fabian Kosmale e9997bc969 Blacklist tst_qquickfolderlistmodel::nameFilters on macOs
Task-number: QTBUG-90468
Change-Id: I9e6ec2a218ba09ef9819eddcd00d090a79cbc6ca
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-20 10:57:29 +01:00
Fabian Kosmale 09563cda63 tst_qquickloader: Make message matching less stringent
For some reason, we do not get the correct line number on macOs.

Task-number: QTBUG-90448
Change-Id: I8dc45011c68e2cbe0d30f4a54f48a74a5a6b0271
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
2021-01-20 10:57:26 +01:00
Fabian Kosmale 81ba03768d qmllint: Skip failing tests
And do not choke completely on extended.

Task-number: QTBUG-90448
Change-Id: I4ac5742ec70f5ba1ed1403be444d9cc7229830c2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-20 10:57:23 +01:00
Fabian Kosmale e98b48f55c QQmlComponentPrivate::setInitialProperties: Do not silently swallow exceptions
Instead, log them with qmlWarning.

Change-Id: Icde7397085841a84aca8a81c716d552c4cd4485a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-18 14:58:30 +01:00
Ulf Hermann 1fa352f0e0 qmltyperegistrar: Remove QML.ManualRegistration
This was needed because we couldn't automatically generate the types for
the Qt object/namespace. Now we can. We should not offer this
possibility to users as we need to see all the types at compile time.
Such an escape hatch will only give us problems in the future.

Change-Id: Ib86fddd0352cf1877a4123cad273c99c4252d8ac
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-01-18 13:43:05 +01:00
Ulf Hermann bdb2b66f3d Add support for extended types to qmltyperegistrar
We generate the extensions as separate types. This also covers the case
of value types being extended by "themselves". We can properly express
this now, so we don't need the hackery of generating the local members
of a type with QML_FOREIGN into the foreign type anymore.

This also fixes interfaces from local types being written for foreign
types.

Fixes: QTBUG-89501
Change-Id: Ic76acd7eef09a92c1e36bd7a649c7a2deb24597b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-01-18 13:42:48 +01:00
Fabian Kosmale 65b88e61a5 QML engine: Fix writing function to property through alias
We special case writing functions to properties, only allowing assigning
them to var properties and QJSValue properties.
This would however break when aliases are involved. This commit fixes
the issue by resolving the alias, and then checking and writing to the
resolved property.

Fixes: QTBUG-90373
Pick-to: 5.15 6.0
Change-Id: Ia09ebe92feeaf8359c99ff9aeadc676b9fcfaa07
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-18 13:20:12 +01:00
Allan Sandfeld Jensen 831efa14e9 Update hovered on disabled QQuickItems
Changes handling of hovered so that the property is still updated on
disabled items, so that other items can bind to it. This is in
particular useful for tooltips.

[ChangeLog][Behavior Changes] QQuickItem::hovered will now update even
when the item is disabled.

Fixes: QTBUG-30801
Pick-to: 6.0
Change-Id: Id17298f657d7631b0e5019138ba33a7d5f863475
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-01-18 11:55:02 +00:00
Ulf Hermann 948c56ca05 qmltyperegistrar: Silence further static analysis warnings
Change-Id: I37a8b76bada2bfe19d0377725eceecbf8322a10e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-01-18 12:13:24 +01:00
Ulf Hermann b368caf7e1 qmltyperegistrar: Always use the local type name for "auto" elements
The local type name is assumed to be under the user's control.
Previously the choice would depend on the order of classinfo objects in
the metatype.

Change-Id: I3199b757aaa9f04821723df1c6331ab447771ee0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-01-18 12:13:16 +01:00
Qt Submodule Update Bot cea45ae20c Update dependencies on 'dev' in qt/qtdeclarative
Change-Id: I8131dd5ea1f123c40279f9bb0f6366459ae31e9a
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2021-01-18 12:46:41 +02:00
Ville Voutilainen eb6525f126 Build fixes for GCC 11
Task-number: QTBUG-89977
Change-Id: I975a859d5252e2721475f86ced6c8dab06ae8c9c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-01-18 12:22:51 +02:00
Fabian Kosmale 12115bbda2 Quick.Layouts: Make plugin optional
This moves the Layouts types into a new library and is meant to make
them availabe to the QML compiler at some point in the future.

Change-Id: I9b2b31a78b0e9ca8b6c0db1fc9272d9941c61814
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-18 09:45:44 +01:00
Qt Submodule Update Bot 704df6f141 Update dependencies on 'dev' in qt/qtdeclarative
Change-Id: Ieb14072d215231223a07e5702f431c4d4e02a555
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2021-01-18 09:01:04 +02:00
Qt Submodule Update Bot 48927f80ad Update dependencies on 'dev' in qt/qtdeclarative
Change-Id: Ibf447d0099831c3ac58db16f5fc75c96e2bb82be
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2021-01-18 05:26:03 +02:00
Qt Submodule Update Bot e9d379a594 Update dependencies on 'dev' in qt/qtdeclarative
Change-Id: I0cd92fa002bf21817384bc0e8b167f71d98f3ba8
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2021-01-15 19:59:02 +02:00
Ulf Hermann 00f3347563 qmltyperegistrar: Silence further static analysis warnings
Change-Id: Ib6e45a06ca5cf606281171fd1dc890f67026b79a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-01-15 17:54:34 +01:00
Ulf Hermann c697a33797 qmltyperegistrar: Silence some static analysis warnings
Change-Id: I1a4bdbb49e6700f2e218ebd349b823350bb09148
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-01-15 16:06:07 +01: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
Fabian Kosmale bd017c18ab Remove qmldir files in src/imports
Those files are automatically generated by CMake nowadays, and not
necessary since the removal of the qmake build system.

Change-Id: I74ba10a58fb17bb28cbfeff49947c962687ad4e0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-15 14:34:21 +00:00
Marianne Yrjänä ad0eaad7a1 Don't set properties on a host tool when cross compiling
Task-number: QTQAINFRA-3768
Change-Id: I2e2491e948e996921c068384012e689ab0762a76
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-15 16:33:10 +02:00
Ulf Hermann e26f69e92d Move QtObject out of the QV4 namespace
This way we don't have to specially prefix the foreign namespace.

Change-Id: I0daa2fe3b8faa205c2c9dfb0f6b1984b2c8e7437
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-01-15 15:33:10 +01:00
Andreas Buhr 6511b17038 Change QQuickShortcut::setSequences to bind to all sequences
When binding a Shortcut to a standard key sequence like
QKeySequence::FullScreen, it binds only to one key
sequence, even though there might be multiple key sequences
associated.
This patch changes the code to emit a warning in this case
and allows to bind to multiple key sequences using
'sequences: [ <key> ]'.

Fixes: QTBUG-88682
Pick-to: 6.0 5.15
Change-Id: I88998aa8858d8f2c0c86e46bae94afd7ceb15b66
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-01-15 15:33:10 +01:00
Volker Hilsheimer 2b15a1fbe2 Pass QWheelEvent data to QML engine via QQuickWheelEvent pointer
Passing events as objects or references in signal parameters requires
copying, and we removed the broken copy semantics from QEvent for Qt 6
as much as possible.

QVariant::fromValue still allows creation of a QVariant from a type
that doesn't have a (public) copy constructor, which is why this
passing of a QWheelEvent through a QVariant to QML went unnoticed.

While QWheelEvent is a gadget and thus supposed to be invokable from
QML, it's still a QEvent. Most QEvents are not gadgets - like QKeyEvent,
QMouseEvent, QTouchEvent. We have QQuick*Event QObject wrappers instead
to provide access to the low level event data from QML.

So, use a single QQuickWheelEvent object instead to pass the data to
QML, that class is designed for exactly that prupose. We need to copy
the data anyway, and since we don't need to create/destroy the wrapper
object for each event, this has no practical overhead.

Extend the QQuickWheelEvent to provide access to the phase information
of QWheelEvent as well, and simplify the reset() method.

Note: making the QQuickWheelEvent store the QWheelEvent directly would
allow passing calls to setAccepted through to the QWheelEvent. That
is left for a future cleanup, and another reason for not passing events
around as copies.

Fixes: QTBUG-89594
Pick-to: 6.0
Change-Id: Id86a9b30c5a8c7c50091e464e368568a7f5ca2ea
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-01-15 13:45:44 +01:00
Samuli Piippo 066945fbc4 CMake: add properties when tools are built
Make sure all properties are added when cross-compiling the tools.

Pick-to: 6.0
Change-Id: Ifec0d2e2a1de2c3302ccf71ba897993d57bed205
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-15 11:14:10 +00:00
Qt Submodule Update Bot 90a8e0ae37 Update dependencies on 'dev' in qt/qtdeclarative
Change-Id: I4b5ed5d636ceca23abaa485977c61747c1570b2d
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2021-01-15 12:21:11 +02:00
Ma Aiguo 3d6e8b7a28 fixs wayland qtwebeneine application webpage close crash
change surface and buffer deleted order

Fixes: QTBUG-88677
Change-Id: I4512c0c2f32f3240288bf640394644f2cc01ab80
Reviewed-by: Ma Aiguo <648709566@qq.com>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-01-15 10:15:38 +00:00
Fabian Kosmale e68b498424 QQmlComponent: Avoid crash when setting initial properties in JS module
In a JS module, we lack a qml context. Thus, we have to check whether
qmlContext is null. In that case we use the engine's scriptContext('s
ExecutionContext) instead.

Fixes: QTBUG-90245
Change-Id: I337e9c7cade472f52fc81c93d1152ff59f8018a5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-15 10:47:05 +01:00
Shawn Rutledge dccd8f0b5c Flickable: ignore trackpad events with px deltas in disallowed direction
If Flickable.flickDirection == HorizontalFlick, then if the accumulated
QWheelEvent::pixelDelta()'s abs(dx) > 2 * abs(dy), clearly the user is
trying to scroll horizontally; otherwise, don't accept the event.
That way the event is allowed to propagate to a parent Flickable that
does allow flicking vertically.  Likewise if the nesting is the other
way around, only allow the inner vertical Flickable to accept if the
flicking is actually vertical.

Fixes: QTBUG-57245
Fixes: QTBUG-80236
Pick-to: 6.0
Change-Id: Ieb0bf9310a67210ce7e9fe7a80c88baef2cc7ede
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-01-15 08:36:36 +00:00
Ivan Solovev 4f8041b014 QuickLayouts: fix crash when layout width depends on parent width
Some tricky cases of setting layout width based on parent layout width
were leading to infinite recursive loop of layout size calculation
(see the attached example in the related Jira task).
Initially the QQuickGridLayoutBase::rearrange() method already had
a recurse check, but it seemed to happen too late, so that the
recursive calls kept happening from the ensureLayoutItemsUpdated()
calls.
This commit moves the recursion check up, so that it's actually
executed before we have a chance to get to the next level of recursion.

Pick-to: 5.15 6.0
Fixes: QTBUG-87253
Change-Id: I473ee219e7b5b13547e33ebbd3a6d884de2c7d45
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2021-01-15 09:35:44 +01:00
Qt Submodule Update Bot 6bccba43c9 Update dependencies on 'dev' in qt/qtdeclarative
Change-Id: If0fd133bf361f65b176d9a08d1bfd61ad2409895
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2021-01-15 07:48:18 +02:00
Jonas Karlsson a2b54d1f44 Fix broken compressed textures
Change-Id: I1c81f1190386a9f7260a6e64862946f648cb6981
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2021-01-14 18:37:30 +01:00