aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmltc_manual/testclasses.h
Commit message (Collapse)AuthorAgeFilesLines
* Correct license for test filesLucie Gérard2024-02-271-1/+1
| | | | | | | | | | | | | | According to QUIP-18 [1], all test files should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I26d72e8de04d4c7c57b3b7838af5d033265de5ba Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Kai Köhne <kai.koehne@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* add QML_UNCREATABLE in the testsSami Shalayel2023-02-021-0/+1
| | | | | | | | | Add the QML_UNCREATABLE macros in the tests where it is missing. Change-Id: I58ef5a27e15f0bb99bc94bf819b38aaad3358432 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Use SPDX license identifiersLucie Gérard2022-06-111-27/+2
| | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Make QQmlEngine resolve closures when executing runtime functionsAndrei Golubev2022-04-271-27/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | QML can create a function which holds a closure in the cases like: onSignal: function() { ... } If the left-hand side is a signal handler (or similar), we want to execute the *inner* function when a signal is called, not the outer one. However, under certain conditions (e.g. we use `this`), the outer function must also be called beforehand to correctly setup the calling scope for the inner function Thus, make the QQmlEnginePrivate::executeRuntimeFunction() do that: always call an outer function first and then the inner one if present. This creates an overhead when dealing with certain signal handlers but we could optimize it later if needed Note that the case `property var prop: function() { return 42; }` where a property contains a callable function is no longer supported by the executeRuntimeFunction() routine (we always call the inner code now). This is fine since qmltc (the main beneficiary of the routine) does not rely on this functionality when dealing with property bindings Given the change, qmltc can be simplified to only work with absolute function indices, ignoring the nesting problem altogether Change-Id: I61f61587b6fe700cb695b3b7a213d9cfab0eb746 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Prototype private property access in tst_qmltc_manualAndrei Golubev2022-01-261-0/+30
| | | | | | | | | | | | | | | | | | | | | | | In theory, private properties could be supported in the compilers through the QMetaProperty. Since we already know each C++ property's index (and QML properties cannot be private), we can use that index for a fast-ish QMetaProperty lookup. QMetaProperty itself has read and write methods, which should be sufficient for all the use cases: * read a value * write a value * create a binding In fact, binding creation on non-grouped private properties is already supported (or almost supported) since bindings already rely on QMetaProperty information. As a downside, QMetaProperty (even without name lookup) is still an overkill compared to static_cast<ClassPrivate *>(QObjectPrivate::get(this)) and then calling READ/WRITE/etc. of a property directly Task-number: QTBUG-91956 Change-Id: If77d2783ac161cb9bdd0bd9d0b397fe88e9c471d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Make QQmlEngine take care of QQmlContext setupAndrei Golubev2021-11-121-2/+20
| | | | | | | | | | | | | Teach QQmlEnginePrivate to create QQmlContextData for object creation purposes. This is necessary for both QQmlObjectCreator and qmltc's generated code Since tst_qmltc_manual used to test roughly the same code, replace the test-local implementation with the new one Task-number: QTBUG-84368 Change-Id: I58a1d4b259f42170d6dfb3809b7dd894bcbacbe1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Rename tst_qmlcompiler_manual into tst_qmltc_manualAndrei Golubev2021-07-151-0/+460
"qmlcompiler" is used as a name for a shared compiler code library, so these tests are slightly misnamed already. Since we go with QmlTC as a new name for the QML to C++ compiler, let's use that for the tests Change-Id: Ib673c5d26bb27d727a4fcf3921bde56619122923 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>