aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
Commit message (Collapse)AuthorAgeFilesLines
* QV4::Heap::GeneratorObject: remove unused memberFabian Kosmale2021-08-021-1/+0
| | | | | | | | | | | | | | The member was marked as a Pointer for the gc; however it was never used, and thus also left uninitialized. This could cause memory corruption or asserts during the gc's mark phase. Fixes: QTBUG-95417 Change-Id: Ide826c0284b6060de8689e6f0dc753011108dba9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit d36b480a956e2437888925aa8a1f5e3cb6c06ebd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Adjust import documentation to mention that versions are optionalFabian Kosmale2021-07-212-15/+24
| | | | | | | | | | | This change also removes the versions from the import statements. Task-number: QTBUG-95302 Change-Id: Ie29e57a618917977b46dff25d13e3ca3eff249b5 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 58783a4f9d411e4bc0fc45bd5da9164e3313f0a3) 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>
* Fix conversion of entries to be added to QVariantListsUlf Hermann2021-06-171-2/+4
| | | | | | | | | 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)
* Document handling signals with parameters in QMLFabian Kosmale2021-05-281-1/+52
| | | | | | | Change-Id: I1fb2a6b744ee1bbef2ceceba119bc8d4bc882144 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit a678309dfd132e1b34662c72b8d8d8515e2826d0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QV4StackFrame: Fix ubsan warningFabian Kosmale2021-05-281-1/+3
| | | | | | | | | | | Calling memcpy with a nullptr is UB, even if we copy 0 bytes. Add a null check to avoid the issue. Fixes: QTBUG-94067 Change-Id: I1d47424754e22f13d7b494ae984b4407b96b1805 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 0b10b83dad91b44559b9f4ddcf9d8bed5544de93) Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Restrict types from unversioned imports only by major versionUlf Hermann2021-05-261-1/+1
| | | | | | | | | | | | | | | | | The versionless import tells us that any version of the type is allowed. We still record the major version because types have to be re-registered for each major version. Any minor version belonging to that major version is allowed, though. Restricting by minor version has the effect of passing the minor version of the "host" type into grouped property accesses. This is certainly unwelcome as the grouped type can have a higher minor version than the host type. Task-number: QTBUG-33179 Change-Id: I73f0f4fdaa00ac13cf91a4c21fd705c9dba070ec Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 5ca899164156ee49770ef3749e6d4b1567c00362) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add Q_ASSERT for _context pointer to pacify code checkerVolker Hilsheimer2021-05-201-2/+21
| | | | | | | | | | | | | The pointer is initialized to nullptr, set in enterEnvironment, and possibly reset in leaveEnvironment. The static analyzer can't know that it is always set before any of other functions is called, so assert that pre- condition via Q_ASSERT. Change-Id: I0198505db40a93227ba52a08c29a351e85b74cc0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit ae1334d827bd386ae34ed5fca8f00dcef83bc65e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Clarify preconditions for using QML_ELEMENT et alUlf Hermann2021-05-111-0/+15
| | | | | | | | | | You need to include qqml.h and you need to make your own class declarations available to the registration code. Change-Id: I98e6b0b8a0acc309482416c3137d8ed782bbdc82 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 40c759cbfa9dfb944a924b6c01fbfd1a15a7a25e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Remove documentation for qmlRegisterType() with no argumentsUlf Hermann2021-05-111-10/+0
| | | | | | | | | | This function has been removed. Change-Id: I10a0b268313c6dbbaf27e66ee0e3a49aae87a531 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 0d7e9d95cbfda42e45a484046280f17d5b16df38) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Workaround mingw compiler bugUlf Hermann2021-05-061-0/+5
| | | | | | | | | | | | | std::acosh(v) wrongly returns NaN for v == Inf on mingw. This makes the ecmascript tests fail. Fixes: QTBUG-93175 Change-Id: Ic6677b3259dad591b946b23d4d6a6859f6e70b0f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 3a8c0fd5cb9bfec439c306593bce19f434c871ce) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Document QQmlComponent::createWithInitialProperties() error handlingMitch Curtis2021-04-271-0/+8
| | | | | | | | | Unlike create(), it can produce errors that should be checked. Change-Id: I78f2e58c8666eb45f6e850c43e3e97a448b2758e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 4f0622f7f553cd841874f0efe65d7f13edeec216) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlComponentPrivate::setInitialProperty: improve error messageFabian Kosmale2021-04-271-2/+7
| | | | | | | | | | We can discern between the case where the property does not exist at all, and the case where we cannot set it. Change-Id: Ia2e8f4cc077a00b90d720db01bff1542a812dea0 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 7275328b967582010abfd59c9a93feef4cb1379f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove extra colonZhang Hao2021-04-241-1/+1
| | | | | | | | | | | JavaScript Grammatical errors, There should be no colon after the function brackets Fixes: QTBUG-93048 Change-Id: I902d490bf810fa60e3b3d2a76de7902345289cfe Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit df8e6136834326e363db49829d227a303e5425ed) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Expand QML_EXTENDED_NAMSPACE's documentationFabian Kosmale2021-04-211-1/+32
| | | | | | | | | | | | Note that it doesn't necessarily need a namespace; mention that it however requires the "namespace" and its contained enums to be exposed to the metaobject system to work. Moreover, add a minimal code example. Change-Id: I814c65b2b59747f902f2291e2f98962eb98d4d59 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit a3959ea9df49b5c30833d49daede5bf60a70897e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix C4267 warning in qqmlirbuilder.cppKai Köhne2021-04-211-2/+2
| | | | | | | | Fixes: QTBUG-92966 Change-Id: I9acdb0d624a0950f9e28c6463530b27d282123e2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit e881ca02897f51175c382401d9713f6f77ede426) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qqmlirbuilder: Fix treating parser warnings as errrosMaximilian Goldstein2021-04-191-1/+3
| | | | | | | | | | | Previously parser warnings (i.e. inline components having lowercase names) were treated as errors. Because these were not handled properly this also resulted in the QQmlComponent with the warning never becoming ready. This resulted applications hanging instead of terminating. Change-Id: Ia5ad3b54edc1b94dd94d0bf771c3494691abec71 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit e49be8d2b1b7acb310873a63f46980d1f0296f95) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Document that QML_SINGLETON only works with QObjectsMitch Curtis2021-04-191-7/+8
| | | | | | | Change-Id: I18c38037cd635fa3300c761b16038b67ac3b0d74 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 03a2e51063de99f85b3b801c7ccd6663163a61b0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix qml module version to use the repo project versionAlexandru Croitor2021-04-161-1/+1
| | | | | | | | | | | | Use PROJECT_VERSION instead of CMAKE_PROJECT_VERSION, so that the repo project version is used in a top-level build, rather than the version of the qt5 project. Task-number: QTBUG-92861 Change-Id: I5a7a09baf81353558e512800746ac24e8e8b9a47 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit cd7bd71d08f1c21648756d0a9fd501ce37a8cc0c) Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Check thisObject when calling various methods on URLUlf Hermann2021-04-141-38/+122
| | | | | | | | | | We should not crash when you try to call them on the wrong object. Rather, throw a type error. Change-Id: I1b146d9c77d838e013408988e02a65a623641f1f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit f32436122f6ac16bfd6f23228b85a6f7c12502b6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QV4EngineBase: Do not create zero-sized array on 32 bit platformsFabian Kosmale2021-04-121-1/+3
| | | | | | | | | | | | Zero-sized arrays are a non-standard extension, and do not work on MSVC. We can instead conditionally add an explicit padding member on platforms where POINTER_SIZE == 8. Fixes: QTBUG-92562 Change-Id: I8462eb05e16c42045c0c95f026321c6e20e5c6bb Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> (cherry picked from commit 506463fe8ae0125f18d6236db9b7cd8b99885d08) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't crash when trying to invoke non-existing string converterUlf Hermann2021-04-091-2/+1
| | | | | | | | | String converters are removed in 6.2 anyway. Fixes: QTBUG-89892 Pick-to: 5.15 6.0 Change-Id: I504c00d99580e3d27d04f420295dd97251657ef4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Do not auto-clean components with live inline componentsUlf Hermann2021-04-091-1/+11
| | | | | | | | | | | The inline components do not hold a strong reference to their outer type because that would be a reference cycle. Fixes: QTBUG-92236 Change-Id: I6d76a114352653210f0ece6c198cf761d3b4eda1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit d0d4cc528ba9e3c39c15a2292066dac1d457abd5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QV4QObjectWrapper: Store the whole signalFabian Kosmale2021-04-083-11/+21
| | | | | | | | | | | | | | | | | | | | | | 90be89d771425044a84e9e79e4e668e065acc825 changed the connection logic to actually pass the receiver to connect in order to fix disconnect cleanup. However, we omitted to change QObjectSlotDispatcher::impl accordingly. The previous logic was: - store the index of the signal in signalIndex - In impl, in the call case, we would get passed the emitting object (sic!) as the receiver parameter. Then we would use the object and the signal index to obtain the QMetaMethod. - From the QMetaMethod, we could get the signal's number of parameters. After the aforementioned change, that does not work anymore: The receiver is now the actual receiver of the signal, thus we get the wrong method, and potentially the wrong number of parameters. To fix this, we now store the complete QMetaMethod of the signal. Change-Id: I868c51edf24a61d14eaf958ed7942da27f54a5c3 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit e7e4eba6875c0f375c4fd03af9b3ed9ea44d0ba1) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix missing 'We mean it' warning for generated qml_compile_hash_p.hKai Köhne2021-04-011-0/+15
| | | | | | | Change-Id: I327d377c80749741274a76dfa609417c005bf6c7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 403ecb6422b499d9033934148994fe251acc937b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Account for qtbase refactoring in qt_internal_add_plugin()Craig Scott2021-03-311-15/+44
| | | | | | | | | | Task-number: QTBUG-88763 Change-Id: I66c22f876be66ca64cd364f574a6f3e862e4abf5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 661f120c1d9e00aff31c432f84f83f58b8aa9c9a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Prevent CMP0116 warning with CMake 3.20 or laterCraig Scott2021-03-301-9/+16
| | | | | | | | | | | | | | | | | CMake 3.20 introduced a change in the handling of relative paths in *.d depfiles referenced by custom commands. To avoid a CMP0116 policy warning, we have to explicitly set the policy to NEW and also change the relative path(s) we embed in the depfiles to be relative to CMAKE_CURRENT_BINARY_DIR rather than the top level binary directory. Fixes: QTBUG-92026 Change-Id: I1a84d29f1a8d5c48bae5bc11596806f1e0e07919 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 8deb1b279fad2b10598af0870dd3b0d99f5ef128) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qqmlapplicationengine: Handle errors during component creationMaximilian Goldstein2021-03-301-0/+8
| | | | | | | | | | | Previously QQmlApplicationEngine did not handle any errors that occurred during object creation (i.e. failures to initialize required properties) which lead to QObject::connect errors and to the error messages not getting printed among other issues. Change-Id: I69bc566a6d349c786cae82a963a621388684c8f5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 890cb4cb236333fd5b112fffc0e9088ecb43f2df) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove unnecessary forward declarationAndy Shaw2021-03-251-1/+0
| | | | | | | | | | This ensures that clang-tidy does not report it as a warning when it is used on application code. Change-Id: I5b84759ff87e7a5b9d119ef27650d92c86f9f831 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit c2634e14273b77f8e4cb77585ab9d7eb7880bf34) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlContext: Mark importedScript() as internalUlf Hermann2021-03-231-0/+3
| | | | | | | Change-Id: Ief7dbd8a2ab870dccdc62f99573987329f91dfb1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit e1d178c3df130ba44259cf7a867f7f07552a974e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlPrivate: Check for frame before setting instruction pointerUlf Hermann2021-03-191-1/+2
| | | | | | | | | | | | In certain corner cases there may be no stack frame available. As the setting of the IP is only used for generating better error messages, we don't have to care about that too much. Change-Id: If249b96a97a2189ef0b2e83f7a057a001a4307cd Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 4c4f39928b9b1cbd7623917d92c277ef256cf18d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Correctly specify extension type for model index value typesFabian Kosmale2021-03-161-0/+3
| | | | | | | | | | Those are not only foreign types, but also extension types which add additional properties. Thus we also need to mark them as QML_EXTENDED. Change-Id: I7a0469f7760887318a2b34bc5fcb85f011c0b0bf Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 0aad1a6c3cb6e1e1e9892a328c0aa84814d94a5a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix argument handling in qt_internal_add_qml_module() and friendsCraig Scott2021-03-152-174/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If OUTPUT_DIRECTORY is set, all the QML files, as well as the qmldir and the plugin should end up in that directory. We should not confuse that with the install directory, which is separate. For qt_internal_add_qml_module(), we can provide the defaults for both OUTPUT_DIRECTORY and INSTALL_DIRECTORY. For the latter, don't support a separate INSTALL_LOCATION keyword, only use INSTALL_DIRECTORY. With these changes, qtbase no longer has to contain qml-specific logic for these paths in QtPluginHelpers.cmake. Refactor the way arguments are collected and passed through to the internal call to qt6_add_qml_module(). This simplifies the code and also exposed that QML_FILES was not being identified as an allowed argument, TYPEINFO was the wrong type of argument and DO_NOT_INSTALL was not a valid argument (or at least was ignored). The qt_internal_add_module() function was also duplicating logic that was largely already implemented by qt6_add_qml_module(). Rework things a little to remove that duplication. Task-number: QTBUG-88763 Change-Id: I629ff63a9f8302c79694970f7b8e664a2b5d587b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit c42d558dc9ff89d452546412ee88a16ae1e324e4) Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Replace std::variant with tagged union in QJSPrimitiveValueUlf Hermann2021-03-122-35/+176
| | | | | | | | | Fixes: QTBUG-91717 Change-Id: Id19e08589206253b96c76bc40a799ccd95b0e0bf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 9970ebb277db5f11c8a7e72099fdd056a6d8310c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix the argument removal in qt_internal_add_qml_moduleUlf Hermann2021-03-111-1/+3
| | | | | | | | | We need to remove all the QML-specific arguments. Change-Id: I99a1712251c5cf9cb6dfe399a2f1177d435a2af7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 078bf865360391d960421cacc5e0d58a6bb07a11) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Ensure that the case of the path will match then QUrl for a UNC pathAndy Shaw2021-03-091-3/+8
| | | | | | | | | | | | | | | | | | | | When a UNC path is used to locate the qmldir then when it is checked later on the original path will be compared against the one that QUrl returns. However, QUrl will convert the case of the host name to be all lower-case whereas the original string may have been in upper-case. For example, QUrl::fromLocalFile("//QT-L-R90X9VHB/tasks").toString() will output "file://qt-l-r90x9vhb/tasks". So in this case, the absoluteFilePath is changed at this point so that it will match what QUrl has for the same path to avoid a problem with it no being found. Change-Id: I2cd5d74bfec06c01635f80574ac1a6d479792855 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit e0400d08755bb40c303bbe330bc3bd6045436c22) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* qv4generatorobject: Fix crash when creating new propertiesMaximilian Goldstein2021-03-082-13/+11
| | | | | | | | | | | | | | | | | Previously HeapObject::GeneratorObject utilized a ValueArray member to store stack information. As we rely on all HeapObject members to have a constant size in order for QV4Table::inlinePropertyOffset to remain accurate, this lead to a memory conflict when a user defined his own property on the Generator. Please do not use ValueArray for any types that are user accessible or that you intend to add properties to. Now the stack information is stored into ArrayObjects instead which circumvents the issue. Fixes: QTBUG-91491 Change-Id: Id6f638bf36a3ae3c9320ac99e67214c48dc81226 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 7ea690c61dabd2485e80e7fae9aed392ba02c846) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QQmlIncubator: handle clear inside setinitialStateFabian Kosmale2021-03-041-1/+1
| | | | | | | | Fixes: QTBUG-91519 Change-Id: Idfe3116c2e94b8e96300d72e15db0bc78425f517 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 2cb306c194625626957fcde44bd56473b0436f83) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Remove INSTALL_QML_FILES optionUlf Hermann2021-03-012-18/+1
| | | | | | | | | | | | | QML files shall always be installed together with the module. Not installing them will just cause confusion. Change-Id: I380b03f1cfce92f2c1fd1e0205e0fa307b385097 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 814ab9d05e947843de5e5708fb644f98db4765bd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use the correct metaObject in captureProperty()Ulf Hermann2021-03-011-23/+30
| | | | | | | | QObject::staticMetaObject is not very useful. Change-Id: Ifc40e1fa08755c59ff6b8ae23a7a1257f34507da Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 89ebac46d7bde1df265b8970132bf09dc790eca2)
* QML engine internals: Do not require mutable QObject pointerFabian Kosmale2021-02-285-12/+10
| | | | | | | | | | | All we need is to get the meta-object from the object. This also works with a const pointer, which is helpful for const-correctness in the FSM framework. Change-Id: Ie554fe81e67bced5f74c844c72e7f9b0df7ded58 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit d0db469788039cf73406ba3f489b7a00b0601f01) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* 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>
* 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>
* Fix QJSValue singletons only supporting object typesMaximilian Goldstein2021-02-222-8/+20
| | | | | | | | | | | 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>
* 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>
* 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-191-0/+4
| | | | | | | | | | | | | | | 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-192-3/+8
| | | | | | | | | | | 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>
* 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>