aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Use __qt_internal_propagate_object_library to propagate object librariesAlexey Edelev2021-06-211-51/+4
| | | | | | | | | | | | Now that __qt_internal_propagate_object_library provides common way to link and propagate an object library it makes sense to reuse its functionality in the _qt_internal_propagate_qmlcache_object_lib function. Change-Id: I83faa3a7452f875982477930c584feae191cce27 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 5ca0e87cb08f4d78027ca201a92f8a2376c23a78) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix some spelling errors in translated messages and commentsFriedemann Kleint2021-06-194-17/+17
| | | | | | | | Change-Id: I34869a9f6aa8cf0e4eadbd2fbeb6d6aca52f9ca7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 47b7bb33463cd45f6c67020d0c64f309010db1bb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Allow using an existing target as a backing targetAlexandru Croitor2021-06-181-5/+3
| | | | | | | | | | | | | | | | | | | | This was previously achieved by passing a NO_CREATE_BACKING_TARGET internal option to qt_internal_add_qml_module. Now it's just a conditional check to only create the backing target if it doesn't exist yet. This aligns with the behavior of the public qt_add_qml_module function. The old option is deprecated and will be removed once all repos mentioning it don't use it anymore. Amends cb293ee3afea3fe0cfabee58b4d34c278f17b709 Change-Id: Ifd478a5495b36c7ba127d4b8bea2ec1225035744 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit b627b4e51b6fb4f01e628021fc0367fe05347675) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't warn "interleaved frame-sync and actual events" if DA is nullShawn Rutledge2021-06-181-1/+2
| | | | | | | | | | | | | | Amends 1285b67a113cd2eb4fc03ec3e4ddd4dfdbe8ae76 It might turn out that this warning is just noise in other cases too; not sure. But it's quite normal that currentEventDeliveryAgent is null when the once-per-frame fake hover event occurs. Fixes: QTBUG-94576 Change-Id: Ib4eed274801b08b62403caec70d0fc3c538e4383 Reviewed-by: Christian Strømme <christian.stromme@qt.io> (cherry picked from commit 8a46606ee7b103100bb09d175ec296b521cf91c7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Adjust QML plugin class name auto-computingAlexandru Croitor2021-06-182-11/+22
| | | | | | | | | | | | | | | | | | | | | | The recent 602d26c38f3767be9bec25302c93fc155c4dce59 change in qtbase is now requiring that CLASS_NAME is always set for qml plugins, to ensure that in static builds we can pre-build a plugin initializer object library. Split out the uri escaping and class name generation code into separate functions. Ensure that the class name is auto-generated by qt_internal_add_qml_plugin if it wasn't manually specified. Pass that value to the qt_internal_add_plugin function. Remove comment about not passing the CLASS_NAME. Task-number: QTBUG-93257 Task-number: QTBUG-92933 Change-Id: I8aa482a7da3a59f5a2213a630ff0be70506efe11 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Remove old configure-related filesJoerg Bornemann2021-06-174-640/+0
| | | | | | | | | | | | | | | | Remove the configure.json and configure.pri files that were used for the qmake-based configure. Remove the .prev_*.cmake files that were a by-product of configurejson2cmake.py. Task-number: QTBUG-89536 Change-Id: I1c41256e773b0cdfdf237802d672b1140b076e99 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit ddcddbb48e5b7a275ef6e1e154d1367707815c6a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add more links to QJSEngine's ownership documentationFabian Kosmale2021-06-171-1/+10
| | | | | | | | | | Also explictily mention again that objects with JS ownership won't be deleted as long as they have a parent. Change-Id: I1eeb5bc8183b6621f24f3751b8152b36acf2eeae Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 906ccb4694bbb3577efc8b8839ed687ebb3e3dce) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmlcompiler: Fully support required propertiesMaximilian Goldstein2021-06-174-6/+61
| | | | | | | | | | | | Previously support of required properties was limited to detecting whether a property that was required actually exists. Now it also enables us to determine whether or not the required property was ever bound to. Still limited by the fact we do not fully support script bindings yet. Fixes: QTBUG-86755 Change-Id: I1abb921d3b4f86a7929f0f829b541088e0c2bf60 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 803a5fda05832b139cc1d76b666777491c708a96) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix conversion of entries to be added to QVariantListsUlf Hermann2021-06-171-4/+6
| | | | | | | | | We should pass the variants themselves, not their constData(). Fixes: QTBUG-94502 Change-Id: I92688348d7b46d74935dc11080b26290f5e8be86 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit dbe34dfa0d42510b804c898b77d6fe145473c31b)
* Avoid undefined behavior in the JITUlf Hermann2021-06-175-6/+10
| | | | | | | | | | | | We need to add an entry to all the RegisterID enums, so that we can mark a RegisterID as invalid. Task-number: QTBUG-94068 Change-Id: I5c13b271eade50fd63327612514ba7ebe33a5c39 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 636481a31110f1819efaf6500b25fbc395854311) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add missing palette property to QQuickWindowMitch Curtis2021-06-171-0/+3
| | | | | | | | | | This was forgotten in 1875ad7f92cad270cc5857d71096a4b46c27c562. Fixes: QTBUG-91365 Change-Id: I8dabf0e2a5a13f0db5feac5c03e3494948393cb7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 249db12b6020cc3a8f04841b1e28cd529f4929d9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Fix QDoc warnings qtdeclarativeNico Vertriest2021-06-172-0/+9
| | | | | | | Change-Id: Ib53e0bc6e30440a5e2c84a0f37bc6cb0e424b821 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 733bb4366e6a59dcfd7be0b33e1ac885eb76e13c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add RESOURCES argument to qt_add_qml_moduleUlf Hermann2021-06-162-5/+11
| | | | | | | | | | | | This way you can pass QML-related resources without triggering a warning. Change-Id: I4b7db5007f1f2ecf0eb556bc4e5bc67f8ac9148d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> (cherry picked from commit 0b7d6fe82fc1a5bcd8a033ff4d0c80dbdc40a070) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Install .qml files from source dir and honor their resource aliasCraig Scott2021-06-162-14/+19
| | | | | | | | | | | | | | | | | | | | | | | | For targets that are built as part of Qt, we currently require all .qml files to be passed to qt_internal_add_qml_module(). We can use that to iterate over the set of qml files and access their source file properties at configure time. The previous approach tried to use the list obtained at generate time, but the source file properties (and therefore their resource aliases) were not accessible and the install locations assumed no resource path or alias. By installing from the source dir, we also address the dependency issue where an install wouldn't cause the build dir copies to be updated. The install target will always install the latest source files with this change. Fixes: QTBUG-94519 Fixes: QTBUG-94520 Change-Id: I6a97a9631ff77c3f7696899a347b83c2eb4b0ca4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit d8b3becc79a8d352d935c33084d29fc2bc088ea8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Remove compatibility functionsAlexandru Croitor2021-06-161-11/+0
| | | | | | | | | | | | | | | | | All our qt5.git repos are marked with QT_NO_INTERNAL_COMPATIBILITY_FUNCTIONS There are still some marketplace repos like quicktreeview that don't have it, but those should be fixed separately. The point is we don't want to override the public qt_add_qml_module function with the compatibility one. Change-Id: I7959025acbf30ac94b6c20799089996a66c06fc2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit c5743097fd8f26eaad13e0b97cac8e7168d08d11) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid UB in qjsnumbercoercion.hUlf Hermann2021-06-161-1/+5
| | | | | | | | | | We need to check for NaN before casting a double to an integer. Task-number: QTBUG-94068 Change-Id: Ib7bfab5ab2e24af950c8f8d7b32c7d411bd8cb71 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit c3b0f8756aee5cc9d965a641088390fff0fed459) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Fix more documentation issuesTopi Reinio2021-06-165-15/+16
| | | | | | | | | | | | | | | * Screen QML type is moved under the main QtQuick import * XmlListModel types are their own documentation project, add a dependency to qtquick.qdocconf. * Remove QDoc comment identifiers from internal, undocumented class. * Fix linking to Qt Creator manual. * Fix linking to QtQuick3D.Model. Change-Id: I3b48165c04ef84288472963e39eafc0868c14c49 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 5a34509af924fb49579c6344856e2236834e2aae) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickPaletteProviderPrivateBase: Do not use paletteData() directlyUlf Hermann2021-06-161-3/+3
| | | | | | | | | | | | Subclasses may override palette() and paletteData() may not be the actual source of the palette data. QQuickPopupItemPrivate in qtquickcontrols2 does this. Fixes: QTBUG-94533 Change-Id: I0434aafab8d0e9fc97f06c04c8dfaef738f4bf09 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 386a5b85b7fa201e26e8795373d77457728c806a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid unnecessary palette allocationsVolker Hilsheimer2021-06-161-1/+1
| | | | | | | | | | | | | | | | | The palette provider allocates QQuickPalette instances lazily in the palette() implementation. Since we only only test here whether a palette is present, uses the non-mutating providesPalette instead. As a drive-by, remove the paletteData() check from setCurrentColorGroup; paletteData() asserts if it would return nullptr, so this check is wrong and misleading. Amends 3675f2b235f32e05cf6d754e81e0e8f8ddd59752. Change-Id: I9701b3520998ec538ef560106a6c6078e7f1c4d8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 7b5c1063de0034d4b9e4345b9493aa3beba62a89) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Allow AOT functions to signal an undefined result via the contextUlf Hermann2021-06-165-2/+17
| | | | | | | | | | | | undefined as value returned from bindings has the special meaning of resetting the binding. As AOT-compiled functions return the actual type of the binding rather than a QV4::Value, we cannot always encode undefined. Therefore, add a flag that tells us whether the result was supposed to be undefined. Change-Id: Iac2298869dde80f6d889240dd8200b2ad83e5dc5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 31ab6b81060abb0db0a68c88c61ea93c7d6bdc60)
* Don't deliver QDragEnterEvent to a drop area that is a child of the dragged itemVolker Hilsheimer2021-06-151-4/+11
| | | | | | | | | | | | | | | | | If the drag.target of the mouse area that starts the drag is a parent of a drop area, then that drop area cannot be dropped on (as it's moving with the dragged item). Due to QQuickDeliveryAgentPrivate::deliverDragEvent calling itself recursively, this is the earliest place where we can block this event from being delivered. Fixes: QTBUG-64128 Change-Id: I495492161d67f7ac60eafb99982fb01ec2374c50 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit e36b5ce4df4239fdf7c54afcc9c261fe1cceafc1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Enhance QQuickRenderControl docs regarding key eventsLaszlo Agocs2021-06-151-5/+15
| | | | | | | | | | | ...and rephrase one of the general description paragraphs to be more accurate. Fixes: QTBUG-93489 Change-Id: If238fff84480720a618c8a337fe416cd08ee9b79 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 6dfed1ee9c8e03780b222a71f6b90fe2016d8994) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix AOT-lookup of values in value typesUlf Hermann2021-06-141-2/+2
| | | | | | | | | | | | We cannot use the lookup metatype before we initialize it, and the calling code cannot know the result metatype before the lookup is initialized, either. Change-Id: I3c691b41dbdb416aa1822c0ea7c4b887398f7908 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 3d4ceaf5b83d74d0c2f87caa45547237b3e315fb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Handle AOT functions returning QVariant in bindingsUlf Hermann2021-06-141-7/+16
| | | | | | | | | | | We need to write the inner data of the variant. Otherwise we create double-wrapped objects. Change-Id: Iacc7b341168c4328172a4e442c16cfbedc6c36c0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit c83249da39ed1ec33bfb35cd630f6b3c0facf7a3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* DropArea: Tell qdoc that DropArea indeed inherits ItemFabian Kosmale2021-06-141-0/+1
| | | | | | | | | | | This ensures that we list all of Item's properties in the "List of all Members" page. Change-Id: Ide7e270fd187e6adc4a20b70b8ef84d2c25a836c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 565290ef3b63fd6ac7b3eac06e64c6a09a2561ad) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Handle half-deleted scope objects in AOT lookupsUlf Hermann2021-06-141-4/+9
| | | | | | | | | | | Apparently we can still call bindings and functions on those. In contrast to the QML engine, we throw a type error here, rather than silently returning undefined. Change-Id: I7d7daf1582d891f6acadb705b50dc36e23f8425c Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> (cherry picked from commit 29fccccb402be67f06852005ffcf20250897b13a) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Handle objects without QQmlData and objects being deleted in AOT lookupsUlf Hermann2021-06-121-16/+81
| | | | | | | | | | | Otherwise we trigger asserts in various places. We also need to generate exceptions matching those the interpreter generates, and we need to decline capturing of nullptr objects. Change-Id: I65744fa3e440939db28d7b16a044f6968500a67b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 603ea30924ea925db2830efa2b2c5cef500ee528) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use Inactive color group in inactive windowsVolker Hilsheimer2021-06-113-3/+19
| | | | | | | | | | | | | | | | | | | | A palette has three color groups (Active, Inactive, Disabled), but we only listened to changes of the enabled state, and always used the Active color group for an enabled item. In order for the Inactive color group to take effect, we need to also trigger the update when the "active" property changes. Instead of connecting yet another signal, deliver WindowActivate/Deactivate to as well, and forward from contentItem to all children which can then update the current color group. Add a test case. Fixes: QTBUG-93752 Change-Id: I4f2b6121e822115aaa5c4faaa5d402932dacc67b Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 3675f2b235f32e05cf6d754e81e0e8f8ddd59752) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmlcompiler: Process properties only once parsing is completedMaximilian Goldstein2021-06-112-94/+166
| | | | | | | | | | | Now we do most properties after the fact which eliminates false positives on unknown types that are not known at the time of traversing the AST. It also allows for chaining inline components. This effectively introduces a two pass system but there are some exceptions (i.e. signals) where some deduction that should be run after the fact still runs during parsing. Fixes: QTBUG-93652 Change-Id: Ic1ac0e8ce2d5d5dfbe80c16a341b10cf2b078d81 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit a991d3c1ec5b679f37ea19d7cbef576f3fc1029e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Rename QmlDevTools to QmlDevToolsPrivateAlexey Edelev2021-06-101-9/+9
| | | | | | | | | | | Rename internal modules to adjust their name to the internal module policy. Task-number: QTBUG-87775 Change-Id: I79245c0e555dcf018494faf3f3f30fbf5f944f1f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 63f36746d1b9f07ae8c642be5e47630b5e4b1f79) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add the 'Private' suffix to the internal module namesAlexey Edelev2021-06-106-16/+16
| | | | | | | | | | | Rename internal modules to adjust their name to the internal module policy. Task-number: QTBUG-87775 Change-Id: I99cbc1214c6f0a9085e921df6225768fd55f5b89 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 7b41628d23308a7cda09df3db5346a6e02bbcdb4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* doc: update the selection model snippetRichard Moe Gustavsen2021-06-102-11/+9
| | | | | | | | | | Fix up some minor issues in the documentation of selection support in TableView. Change-Id: Ica2c0014f4e7f960332c283c1ff83a6b0bdd7df2 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> (cherry picked from commit c60dc57dda052f800ac5ea16c208c2c70b366358) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Pass the --resource argument to qmlcachegenCraig Scott2021-06-091-2/+13
| | | | | | | | | | | | | The qrc files are needed to analyze relations between the different QML files. Change-Id: I288434a0822de7b9e55696c90f768eb9e5283ffc Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Craig Scott <craig.scott@qt.io> (cherry picked from commit 919e16acaeac6e92f5f402f0d81cf988c5b02cf0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmllint: Move a lot of warning logic to qmlcompilerMaximilian Goldstein2021-06-093-26/+529
| | | | | | | | | | | Moves the majority of qmllint warning logic to qmlcompiler, making them available to all tools using the library. The end goal is to get rid off the additional AST visitor in qmllint altogether (We can't quite yet until we have ported over type interference). This also prepares qmlcompiler to move to a two pass approach which isn't fully implemented in here yet due to the size of the change. Change-Id: Id2e108340d26a75085ce6ed97d56dec03ea3a12d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 3c95bf5b6df7cfd12af3755d11b34db721e23f19) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Allow property observers on readonly propertiesUlf Hermann2021-06-083-13/+27
| | | | | | | | | This makes it necessary to tolerate evaluate() calls after the engine is gone. With non-QProperty properties this can't happen as the engine controls the observers. Change-Id: Ia700a10ad847b8a174b2346a4ad7a4de7afb0c83 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove pointless evaluate() methodUlf Hermann2021-06-082-25/+1
| | | | | | | | | We never want to evaluate with a QList<QVariant>. The only place where this was called used an empty list. We can just as well use the call with void** then. Change-Id: I9eb93ee37eecec8b01864cc86174d80e5705986c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix invocation of qmlcachegenUlf Hermann2021-06-081-3/+3
| | | | | | | | | | --direct-calls and --qmljs-runtime do not expect any further arguments. Furthermore, the qmlcachegen invocation depends on the qmltypes file for the same module. Change-Id: Ib28a0c931a09986f96f426d4098b25243b82a7b4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* qmltyperegistrar: Do not generate namespace metatypes for non-namespacesUlf Hermann2021-06-081-9/+40
| | | | | | | | | | If the target type of a QML_FOREIGN_NAMESPACE is not a namespace, we must not generate another metatype for it because otherwise we get two metatypes with the same name and ID. Change-Id: I0111e995a227c4a5d4c99e47662b7f86767e0da1 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Rename QQmlMetaType::metaObjectForMetaType into metaObjectForValueTypeUlf Hermann2021-06-0812-18/+18
| | | | | | | | It really only works for value types and it's not intended to do anythign else. The name should reflect this. Change-Id: Ib73bf7e9655971f7826fe72145e2d2fab363363c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlJSScope: add method to query the owner of the propertyAndrei Golubev2021-06-072-5/+56
| | | | | | | | | | | | | | | | When calculating absolute property index from the relative QQmlJSMetaProperty::index() value, we need to know the QQmlJSScope that owns the property (to start the value calculation from). The logic of finding the property is non-trivial (due to extension types), so custom QQmlJSScope traversal should really be discouraged While adding a new method, revise existing QQmlJSScope traversal method and make it more generic, so that we could return both (const) QQmlJSScope * and QQmlJSScope::{Ptr, ConstPtr} depending on the use case Change-Id: I84ce038a6a40cdcab3f33ba6a448baa672d62826 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQmlBinding: provide setTarget overload without QQmlPropertyDataAndrei Golubev2021-06-072-3/+8
| | | | | | | | | | | | | Similarly to create(), setTarget() also accepts QQmlPropertyData which is a bit too much for the object creation compiler case. Providing minimalistic API instead allows not to construct QQmlPropertyData when QMetaProperty is available Related to 06893b68c6b1f70cb7ff255db1fa9d14697403fa. Change-Id: I9a54dbdf6b7cddeeda995558a2539254c26a9c6d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
* Don't allocate QStringList to compare first elementFabian Kosmale2021-06-071-1/+1
| | | | | Change-Id: Ib5ea29581e4b15d071a395e10b0705d57495d387 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Doc: Use \deprecated instead of \obsoletePaul Wicking2021-06-074-11/+11
| | | | | | Task-number: QTBUG-93990 Change-Id: I74e7dcc04fd5552660e14b011d1a005a7abcb690 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* qmldom: writeOut, write reformatted QmlFawzi Mohamed2021-06-0519-40/+3372
| | | | | | | | | | | | Adding writeOut: support for reformatted Qml - linewriter: write line by line with caching, callbacks, SourceLoaction updating - outwriter: write to line writer, and keep track of updated file locations and reformatted ScriptExpressions - reformatter: reformat javascript Change-Id: I4bdc393fb2d9b5a3db944a850719c24ef8726d15 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmldom: compare and dump to file, domtoolFawzi Mohamed2021-06-059-0/+1014
| | | | | | | | | | | * qqmldomfieldfilter: ignore fields or types in dump or comparison * qqmldomcompare: compare DomItem * qqmldomfilewriter: safely write to a file (keep backups, avoid overwrite before success is confirmed, avoid overwrite if equal) * qmldomtool: command line tool to dump dom Change-Id: If4fbff7dff70d3a780293ac8b458f674e8f91591 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmldom: representation and load of Qml FilesFawzi Mohamed2021-06-0525-1850/+12584
| | | | | | | | | | | | | | - qqmldomitem: main API for generic access to the Dom - qqmldomtop: represent top level elements: DomEnvironment and Universe - qqmldomelements: definition of the classes representing Qml - qqmldomastcreator: instatiate Dom elements from AST - qqmldomcomments: represent comments in Qml - qqmldomexternalitems: represent files - qqmldommoduleindex: represent types in a module - tst_dom_all: combined test running all dom tests Change-Id: If2320722bc3e6eaab9669ecec6962d5473184f29 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Check for nullptr in QQuickWidgetPrivate::render()Shawn Rutledge2021-06-041-1/+2
| | | | | | | | The static analyzer says offscreeWindow can be null: https://testresults.qt.io/codechecker/daily_analyses/qtdeclarative/dev/qtdeclarative-dev-20210604-1285b67a11/qquickwidget.cpp_clangsa_765c85feff0c596c102ea775bb61e6c7.plist.html#reportHash=be277e8f02c65d088658b2397b335b7c Change-Id: Idfb6b358044f2719157fd85f72538a1e1ad30a34 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Add DragHandler.activeTranslation and persistentTranslationShawn Rutledge2021-06-043-14/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you want to set target: null and then bind translation to some object's x and y properties directly (perhaps an Item, a Qt Quick 3D Model object, etc.), it's a lot less trouble to use a translation property that does not keep changing back to 0,0 every time a gesture begins. In hindsight, the translation property should have been the persistent one (for consistency with the fix for QTBUG-68941, in which we made PinchHandler.scale persistent and added activeScale: b4d31c9ff5f0c5821ea127c663532d9fc2cae43e). But for several years, the translation property has been restarting with each gesture; so now we add a persistentTranslation property. The new activeTranslation property has the same value as the translation property (which is deprecated). Also, the persistentTranslation property is settable, because in some UIs there may be multiple ways to move the same object, and there needs to be a way to sync them up. Also fixed a bug: when minimumPointCount == 2, QQuickMultiPointHandler::wantsPointerEvent() doesn't initialize d->currentPoints until two points are pressed. But often, one point is pressed, and in the next event, the second point is pressed while the first is held Stationary. So QQuickHandlerPoint::reset() needs to set pressPosition and scenePressPosition on both points at the same time, because it is called on each HandlerPoint in d->currentPoints at that time when both points are pressed. So if any point is pressed, act as if they all were freshly pressed. Without this fix, the centroid's scenePressPosition is wrong (based on the average of 0,0 and the second point), therefore a "jump" was occurring when persistentTranslation is used to directly drive a binding (like the tilt in map.qml). [ChangeLog][QtQuick][Event Handlers] DragHandler.activeTranslation now holds the amount of movement since the drag gesture began. DragHandler.persistentTranslation holds the accumulated sum of movement that has occurred during subsequent drag gestures, and can be set to arbitrary values between gestures. Task-number: QTBUG-94168 Change-Id: I1b2f8ea31d0f6ff55ccffe393bc9ba28c1a71d09 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Check for null pointer in QQuickPointerHandler::approveGrabTransition()Shawn Rutledge2021-06-041-2/+3
| | | | | | | | | | Found by static analysis: https://testresults.qt.io/codechecker/daily_diffs/qtdeclarative/dev/qtdeclarative-dev-20210604-1285b67a11/qquickpointerhandler.cpp_51058486.html#reportHash=9b76a76200c3a2eceb0e115776dda98b Amends b09ce7dcd8ecf24ef23da8197a64e3fced3fc894 Pick-to: 6.1 Change-Id: I4c35f648be9513e5e237d9b8d4e502e40e9f8a76 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Allow using existing backing target for a new qml moduleAlexandru Croitor2021-06-041-19/+34
| | | | | | | | | | | | | | | | | | qtwayland has a case where the backing target is always created by qt_internal_add_module and it is promoted to a qml module conditionally only if Qt::Qml target exists. qt_internal_add_qml_module always tries to create a backing target. Allow passing an internal only NO_CREATE_BACKING_TARGET option to re-use an existing target, while still applying necessary qml-specific install rules. Amends 1c4ba17015fe99da48ce73fab75ecc60cf9cb975 Task-number: QTBUG-91621 Change-Id: I15f4da4fd3a3ab991c78e8c77975677a0d820fd5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>