aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Split event delivery code from qqwindow into qqdeliveryagent.cppShawn Rutledge2021-02-253-1967/+2025
| | | | | | | | | | | | | | | Event delivery logic will live in util/qquickdeliveryagent.cpp now. The actual QQuickDeliveryAgent class will be created in a followup patch. This patch is roughly the same as this series in dev branch: 44eebdf5f5fe3bd7be16bc0ef05f8fc63e38a9f2 ca9c29348a9e149109d9d381cdd44538160b7898 902c68f3ceaae407306ca5a3fdcdcfa159009e78 79f0af6cd097f55eacb763574e173f134c9c0a32 0ccea574f8e4e9a3954ef3bb95909565957bacbe dbdee417dc073a0da3c99849a3f393fa3cb660e9 Change-Id: I25f234d0550768cb01cd80c38525291202b25d99 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Don't invalidate unaffected render ordersEskil Abrahamsen Blomfeldt2021-02-252-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | If you have a list of render orders A, B, C, then A and C changes, we also invalidated B. This was to avoid the situation where B was ignored by the batching algorithm and A and C would end up being batched together. This has a performance impact for some scenes though, where you might have top level and bottom level items that constantly change, causing all geometry in the scene to be uploaded every frame. Instead of doing this, we skip invalidation of B, but include its bounding rect when checking for overlaps, so that we still avoid batching A and C together but without the need to re-upload B. Fixes: QTBUG-90632 Change-Id: I462cf1938360643ca9fa1425ae8c8e08b534fd76 Reviewed-by: Andy Nichols <andy.nichols@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Michael Brasser <michael.brasser@live.com> (cherry picked from commit 9aa3db2e19b2e1622b878cf34b1978f4fdbcac39) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix some issues in translated messagesFriedemann Kleint2021-02-242-6/+7
| | | | | | | | | | - Fix spelling errors - Remove whitespace from message Change-Id: I44889f63d67f85e11fb0aac6296e4e36ec996121 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit cccef3886fc50df5e0b39540885e3b5518ece2b1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QtQuick.Shapes: Declare dependency on QtQuickUlf Hermann2021-02-243-0/+11
| | | | | | | | | | Otherwise qmllint and other tools won't know what QQuickItem is in this context. Change-Id: I68da08cf2c41f17a2623f30303ac8f66b7b9329a Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 1a4b0929de72d533c56dd38a9eaf49d21f16e197)
* qmllint: Support enum types from other scopesUlf Hermann2021-02-244-1/+21
| | | | | | | | | | | | In qmltypes, enum types can be scoped, just like in C++. Resolve those scopes. Also, resolve the enum scopes only once, in order not to duplicate the types. Change-Id: I095ec11f0ffec8e0e5f1034023c8956d2d39f660 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 75b99a10b3229c7ed14ded8622f3334c3cd02af5)
* qmllint: Check for existence of property typesUlf Hermann2021-02-2412-28/+119
| | | | | | | | | | | | | | | | For each binding there should be a property and that property should have a type we recognize. Enums can be property types in C++. We support this by adding child scopes for such enums. The child scopes are then referenced by the QQmlJSMetaEnums and derive from int. The test then reveals that we were missing a few properties in QtQuick.tooling. Add those. Change-Id: I1deef94393ee0e17d34c2dc5980ebfbf25417f36 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 08c8e8ac3ba8eb23ae5c158990f5d029ac9988ed)
* Add finalizer to call qt6_import_qml_plugins() automaticallyCraig Scott2021-02-242-0/+24
| | | | | | | | | | | | | | | | | | Any target created by a call to qt6_add_executable() that also links to the Qml target will now automatically call qt6_import_qml_plugins() in qt6_finalize_executable() for scenarios that need it. This is only relevant for static builds and only when not doing a top level Qt superbuild. The finalizers feature requires CMake 3.18. If using an earlier CMake version, the project is still responsible for calling qt6_import_qml_plugins() itself. Fixes: QTBUG-86669 Change-Id: I0f0b3f700ab6f1240b2373cb4155f52dc8991d2e Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit c71c48f5125c116f01f615f51f10e4f2877b2b1d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update dependencies on '6.1' in qt/qtdeclarativeQt Submodule Update Bot2021-02-231-2/+2
| | | | | Change-Id: Ib40a74178858d6d35befd88189f389f5dc0999d1 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* CMake: Handle the case of QML resources in the BINARY directoryJarkko Koivikko2021-02-231-1/+6
| | | | | | | | | | | | | | | | | | | Qt Virtual Keyboard copies some QML resources to the BINARY directory for dynamic configuration of resources. _qt_internal_quick_compiler_process_resources assumes that all QML source files are located under the SOURCE directory. This is perfectly fine as long as the SOURCE and BINARY directories are located on the same drive in Windows. Otherwise, the relative path cannot be resolved and cmake is aborted because a directory cannot be created below. Fix this problem by making sure that the relative path is resolved against the correct base directory. Change-Id: I93e31e9f2720d448a48b6e8075cee0c01f59b584 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 1bc4fb2e400c4c5865282a711d1a443ca0ab26fa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update dependencies on '6.1' in qt/qtdeclarativeQt Submodule Update Bot2021-02-231-2/+2
| | | | | Change-Id: Ic5096aa242962e1ed36f0b2887bd2375bdd64955 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Update dependencies on '6.1' in qt/qtdeclarativev6.1.0-beta1Qt Submodule Update Bot2021-02-231-2/+2
| | | | | Change-Id: Ibc5a50e5b8ec22b80322e3e615e51853d441dbfc Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Update dependencies on '6.1' in qt/qtdeclarativeQt Submodule Update Bot2021-02-231-2/+2
| | | | | Change-Id: Idd6c7675106456d72780e4ae50cd3d18d9caced8 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Fix QJSValue singletons only supporting object typesMaximilian Goldstein2021-02-223-8/+62
| | | | | | | | | | | Now primitives such as integers and strings should also work. Fixes: QTBUG-85615 Change-Id: I201d1844b7272ca50e32f1e33e9ac357b5e68dfe Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 64102ae231317eb6f637304918e55153dadef72d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update dependencies on '6.1' in qt/qtdeclarativeQt Submodule Update Bot2021-02-221-2/+2
| | | | | Change-Id: I8055fff21734282eed9acd669e62445f0a5700a1 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* CodeChecker: Assert that pointer canot be nullFabian Kosmale2021-02-221-2/+3
| | | | | | | | In the AST, the type always has a name. Change-Id: Ifc299573132b9edeb4c0b96054a101d95332236a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit c6c37d12633cc9fc3be1a1aa8e18d1013f3ab2d9)
* QML: Make retrieval of a signal name from a handler accessibleUlf Hermann2021-02-193-18/+28
| | | | | | | | | We want to do that in other places, too. Change-Id: Id42495d239c2dccffa390478c8b57ec1acab7408 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 1daee0b03050487cfc4b483262ca73e5a24267ff) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove Windows 7 VM workaround from rhi initLaszlo Agocs2021-02-191-11/+1
| | | | | | | | | There is no longer a Windows 7 configuration in CI. Change-Id: Ic190735301f03e84974132ed1183adfd9352187a Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 4d9d5ab8187a2e1391afdcd0716bd43196040984) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Improve QSGMaterial docsLaszlo Agocs2021-02-191-15/+31
| | | | | | | | | | | | | | Remove a Qt 6.0 editing issue where the docs continue saying "QSGMaterialShader and QSGMaterialShader", which is a leftover from 5.14/5.15 times when QSGRhiMaterialShader still existed. While we are at it, improve the code snippets and talk a bit more about type(), inspired by recent mailing list discussions. Change-Id: I4b21ed00285bf18e22e64a7574a273abdf8be3e5 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 258077e00eb8f3f4b0ef21a9a0395268b6c86532) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix custommaterial example with OpenGLLaszlo Agocs2021-02-193-1/+1
| | | | | | | | | | | | | | The member names in the "uniform block" (which is in practice mapped to a struct uniform with GLSL) must match between the vertex and fragment shaders, even if the member is not used in one of the shaders. This is because OpenGL/GLSL's interface matching rules, which would cause the shader program fail to link due to a mismatch in the structs in the two shaders. Change-Id: I9a928b4b20fdff14530c16a93a52967ce6c328a3 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 21d9cd844e5c572b03b73400c110adc6fc78ae75) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmllint: Resolve attached property scopesUlf Hermann2021-02-198-43/+69
| | | | | | | | | Previously, all attached property scopes were just ignored. Task-number: QTBUG-84369 Change-Id: I324becf92402eacea9d150e6e51359edae562dde Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit f34ecc8f99522b69d1aaa3d5d233add9ed9b6da9)
* Layouts: Depend on QtQuickUlf Hermann2021-02-193-0/+10
| | | | | | | | | | | If we don't declare the dependency our tools won't figure out where QQuickItem comes from when analyzing the dependency hierarchy of layouts. Change-Id: I389c9e513a3a65143aa6b6fbf508eee584970181 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit fe7318a6cf4398802f919766f2ac585bd844cf48)
* qmllint: Fix false unknown grouped property warningMaximilian Goldstein2021-02-194-9/+8
| | | | | | | | | We seem to be checking grouped properties twice by endVisit(UiObjectBinding*) and endVisit(UiObjectDefinition*). So the UiObjectBinding variant is removed here as this gets run before all type information is available. Change-Id: Idfe23869792f787df6109cde3b6bc1d96cce3dc3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 4660f51f25a6c56182dff0ea24f7c1ad2bac9cea)
* qmllint: Fix segmentation faultMaximilian Goldstein2021-02-194-1/+23
| | | | | | Change-Id: Ie04ad4221b25628687c2575facf90488b83d21bf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 5fb34b67b810ca284c216009925f4f38220c4510)
* qquicktextinput: Fix validation for IM eventBartlomiej Moskal2021-02-192-2/+28
| | | | | | | | | | | | | | | | | | If validation did not pass after text pre-editing is finished, it need to be roll back to state before pre-editing started. Before this change, if validation did not pass, text was always rolled back to previous state. In pre-editing text case, it means back to the state in which part of the text was removed (and later changed to pre-edited text). It may cause a situation of removing part of the text that was already validated Fixes: QTBUG-90239 Change-Id: I3ec39e0f6b8a93d4e6fd190af30d4c80a0e495eb Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit b1ae151acc80254ab0ec2937c55b99223205875c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* docs: Fix documentation of the Locale numberOptions propertyShawn Rutledge2021-02-191-1/+1
| | | | | | | | | | Document the property not the enum type. Fixes: QTBUG-91196 Change-Id: Id11a436caf1c683a0e70a1b8e8ce86c6118725d8 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 3670395af58f21f203ce2289a04feef7c6de53f5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlProperty: document propertyMetaTypeFabian Kosmale2021-02-191-2/+9
| | | | | | | Change-Id: Ida75d35fb4eced20b206caf3bc247c734679cf10 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit edf8106be2b94dea5bd3b8a446705521957bf973) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlPropertyPrivate::signalExpression: handle object being nullFabian Kosmale2021-02-192-0/+14
| | | | | | | | | | | | | | | QQmlData::get expects a non-null pointer, therefore we need to check whether the object still exists. Note that while this fixes the crash in the referenced bug, PropertyChanges still does not support a dynamic target. Task-number: QTBUG-46350 Change-Id: Ifeecf5df83e87468a1d314ce2b120006124d6f4b Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 1ff376e64bf5af6df7e0079700d2b9164037dc89) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Fix warnings about snippets in qtdeclarativeNico Vertriest2021-02-194-5/+14
| | | | | | | | | | | Cannot find file to quote from: 'code/backend/backend.pro' Cannot find file to quote from: 'code/doc_src_qtqml.pro' Cannot find file to quote from: 'code/doc_src_qtquick.pro' Change-Id: I26642a375a659a3d8dbda097702ffc2f68d10137 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit ca7d2c1f4ca010096b668108200cd9f1357a5b2e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_qquickdesignersupport: skip crashing testsSamuli Piippo2021-02-193-7/+10
| | | | | | | | | | | Blacklisting doesn't work when the tests crash, use the emulation detection instead and skip tests. Task-number: QTBUG-90869 Change-Id: Icd9cff8b9d45edc2f97ae13acdf0e71ed44aa0e4 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 77156cd98f3e29d9bd89df335bb172e59da43483) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QML: Do not JIT-compile AOT-compiled functionUlf Hermann2021-02-191-2/+4
| | | | | | | | | The AOT-compiled code is supposed to be the best one if available. Change-Id: Ib66a3d8e57cf437e0a5e6395f2ec6a0ab21f39c0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit d446cb746f4e8e84efea8b3afda530d6da52d5f5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix dependencies between metatypes and qmltypesUlf Hermann2021-02-191-0/+1
| | | | | | | | | | | | qmltyperegistrar needs all the metatypes declared in the foreign types file. Otherwise it produces incomplete output. Change-Id: I5876ca9add59fafa54e2d2e6eb2de058c9595870 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit ce950d619aef3ad0534544b2e029a6f025b256a5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQuickStackLayout: Fix include directiveUlf Hermann2021-02-191-1/+1
| | | | | | | | | | This include would only work when qquickstacklayout_p.h was included by a file in the same directory as qquicklayout_p.h. Change-Id: I872e3e85ebe08b58f9bb611d36c8428ff6bccdf9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 424030efdb1ca416c91e4360865d7f4fd62f4b3f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QJSPrimitiveValue: Implement modulo operatorUlf Hermann2021-02-192-1/+33
| | | | | | | | | | | The modulo operator has special semantics in JavaScript. We need to mirror those. Task-number: QTBUG-84369 Change-Id: I5a4d63a01e232686832c83f2def0faf57e7359c2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 84cf29933cee44e09590fc89ae800dd453f664ca) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QJSValue: Allow casting integers to enumsUlf Hermann2021-02-193-0/+26
| | | | | | | | | You can also cast enums to integers, after all. Change-Id: I283d3dd280eeb44ba22bb45ca9be69e5358d5781 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 453be4e6065a323e7fc0ea93fa0bee845d2020cd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix lookup of existing inline components by nameUlf Hermann2021-02-191-1/+1
| | | | | | | | | Previously this would always return the inline component iwth ID 1. Change-Id: I49dc6eb64fcd8428667f3b22afcb7212aa792db3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 7104a3a6f8fe518bd8a0d0d246c0f65df340ee38) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update dependencies on '6.1' in qt/qtdeclarativeQt Submodule Update Bot2021-02-191-2/+2
| | | | | Change-Id: I8b597126b092273837e50e02b305d2d90821c33d Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Update dependencies on '6.1' in qt/qtdeclarativeQt Submodule Update Bot2021-02-181-2/+2
| | | | | Change-Id: I2d5322e1f624507b9aa6901c28cb2ff99b3d7c9d Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Update dependencies on '6.1' in qt/qtdeclarativeQt Submodule Update Bot2021-02-181-2/+2
| | | | | Change-Id: Icfffada9a9f3f1775ab4cc19052d0ff99fd2b97c Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* qmllint: Don't create properties for "on" assignmentsUlf Hermann2021-02-163-12/+26
| | | | | | | | | | | "on" assignments are assignments to the default property, with the property given interpreted as the target for the inner object. Change-Id: Ia93a171f759964d2c00d6c0293a5434f588123af Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 67c8afff346eae27c6fb833661d179326dd8b153) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Rename DBG_* logging categories in Qt QuickShawn Rutledge2021-02-158-71/+71
| | | | | | | | | | | | | | We prefer camelCase rather than SHOUTING for module constants. It fits well to have logging categories as constants that start with lc. That has become conventional in various modules, and we've been using that convention already for some time when defining new logging categories. Now we finish renaming the Qt Quick ones, ahead of a refactoring which will result in moving some of them around. Change-Id: I47003b9e525fe70d35dbd2450d03379b52d67c1d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit a8685fdb4d57c0ba36d80c395c2ae878595f04da) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qmllint: Warn about too many or mismatched signal parametersUlf Hermann2021-02-154-16/+82
| | | | | | | | | | | It's easy to mess this up when you transform your signal handlers into functions. Task-number: QTBUG-89943 Change-Id: If35be2f6828a0e19aada19abb41d8135b0c6ab45 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit f0ecad1e99461109e69cd2b0f6271012c20005dd) Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* qquicktextinput: Fix Undo history for IM eventBartlomiej Moskal2021-02-151-4/+6
| | | | | | | | | | | | | | | | | | | Do not set m_cursor (cursor position) before calling removeSelectedText() in processInputMethodEvent(QInputMethodEvent *) method. Before this change, DeleteSelection command was added to history with new cursor position. If this command will be later rolled back, cursor position will not be set correctly. It should be set to position before handling the event. Task-number: QTBUG-90239 Change-Id: Ib5e46d232e6b32f904e745da4f9e5bc03a58963f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 6ec8c62ca22c363fa00e085de10198a90e3d65dc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update dependencies on '6.1' in qt/qtdeclarativeQt Submodule Update Bot2021-02-131-2/+2
| | | | | Change-Id: Ic664a78fc52d7e2b0ca04b04d062ffbc3b58e355 Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* MouseArea: fix containsMouse behavior during visibility changesVolker Hilsheimer2021-02-123-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Change-Id: I04870d6e914092275d9d790312fc702fb99f2935 Done-with: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit ba1246c543118515ea244787f3d7f9c1133ccf0f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QML: Warn about usage of injected signal parametersUlf Hermann2021-02-1210-23/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | You should declare functions with formal parameters if you want to use parameters passed by the signal. We need to generate two different warnings because there are two code paths by which such parameters are injected. If we compile with qmlcachegen, it simply inserts a lookup instruction in to the byte code. This lookup then triggers our special hack expressly made for signal parameters. If we don't compile using qmlcachegen, a function declaration with formal parameters is synthesized. We mark those formal parameters as injected and warn if we see one of them used. [ChangeLog][QML][Important Behavior Changes] The automatic injection of signal parameters into signal handlers is deprecated. This is because we cannot determine the names of the signal parameters at compile time. Furthermore, also for human readers it is difficult to discern between arguments, context properties, properties of the current object, and properties of the root object of the component. Requiring the signal parameters to be explicitly named resolves some of this confusion. You can turn the deprecation warning off using the "qt.qml.compiler" and "qt.qml.context" logging categories. Task-number: QTBUG-89943 Change-Id: If0a5082adb735a73efd793868b3a55bc7d694cbe Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit df70d4f76f9c1c7b3de9ae91877df803c18b1264) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use functions as signal handlers when accessing parametersUlf Hermann2021-02-1238-59/+62
| | | | | | | | | | Injected signal handlers are bad practice because they aren't declared. Task-number: QTBUG-89943 Change-Id: I3a691f68342a199bd63034637aa7ed438e3a037b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 4cc91a6a0e4f9063233a4d6554ae64855cf99c14) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Replace QScopedPointer with std::unique_ptrVolker Hilsheimer2021-02-124-27/+27
| | | | | | | | | Fix compiler warning, QScopedPointer::take was deprecated in Qt 6.1. Change-Id: I67045bce97efb082b1b7467a6c24d5dbf996fdc1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 070072e7cabd6f4f26f4938b1616e56254ad25d9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update dependencies on '6.1' in qt/qtdeclarativeQt Submodule Update Bot2021-02-121-2/+2
| | | | | Change-Id: I0ee77d1561fa1cbe77325009db03d3b01e0c5d8f Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
* Doc: Avoid unqualified lookup in the signals documentationUlf Hermann2021-02-121-2/+2
| | | | | | | Change-Id: Ibcb20311c7e5a56038c738da77d9dfcc9464bce4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 165ba01a6833e88896cf3f323d8fad67561e1edd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QML: Warn about variables being used before their declarationUlf Hermann2021-02-127-22/+71
| | | | | | | | | | | | | | | | | | | This collides with injected signal parameters. qmlcachegen cannot tell those cases apart. [ChangeLog][QML][Important Behavior Changes] QML warns about JavaScript variables being used before their declaration now. This is almost always a mistake. It is particularly dangerous in the presence of injected signal parameters because qmlcachegen cannot identify a name collision between an injected signal parameter and a variable being used before its declaration. It therefore miscompiles such code. You can turn off the deprecation warning using the "qt.qml.compiler" logging category. Task-number: QTBUG-89943 Change-Id: I8a9424ca8c6edd562402fe5c560ba7e8344b5585 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit ab71cdafca87513a4e214d3af056d8990bc1eddb) Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>