aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlmetatype
Commit message (Collapse)AuthorAgeFilesLines
* tst_qqmlmetatype: Improve error messages on mismatchUlf Hermann2024-04-231-2/+10
| | | | | | | | We want to know what types were involved. Change-Id: I456b35e6688b01c14baa681fe62a461a5f082f5d Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Correct license for test filesLucie Gérard2024-02-272-2/+2
| | | | | | | | | | | | | | 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>
* CMake: Make qml tests standalone projectsAlexandru Croitor2023-07-051-0/+6
| | | | | | | | | | | | | | | | | Add the boilerplate standalone test prelude to each test, so that they can be opened with an IDE without the qt-cmake-standalone-test script, but directly with qt-cmake or cmake. Boilerplate was added using the follow script: https://git.qt.io/alcroito/cmake_refactor Manual adjustments were made where the code was inserted in the wrong location. Task-number: QTBUG-93020 Change-Id: Ia68c9d263e7454f0c4a26c29b10f1c535d08e2f6 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
* QML: Register all builtinsUlf Hermann2023-05-221-0/+90
| | | | | | | | | | | | We need run time access to the QQmlType instances of all the builtins in order to properly coerce types without special casing everything all the time. Since we can now have QML types without metaobjects, we need to check for the metaobject in a few places where we didn't need to check before. Change-Id: Ib22cbb12c60ebdce4897c3f3338851e8b925926f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlMetaType: Clear property caches on qmlClearTypeRegistrationsUlf Hermann2023-02-141-0/+14
| | | | | | | | | | | | Otherwise we may retain dangling pointers referencing invalid property caches. Some metaobjects are created on the heap. If the memory manager decides to re-use the heap space for new metaobjects, we can retrieve the invalid property caches. Pick-to: 6.5 6.4 6.2 Task-number: QTBUG-110933 Change-Id: Ic00bb852151bcf58ba6ae798a6bf2cea686a9e10 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QML: Fix interceptors on value types ignoring fast changesUlf Hermann2023-01-252-0/+39
| | | | | | | | | | | | | | | | | | | | | | If a property is changed and reverted in short order, any animation attached to it may not get a chance to take effect in between. In such a case it looks like we don't have to update the interceptor when reverting, but we actually have to. The animation needs to be canceled, after all. We now have to fix the case of writing different properties of a value type sequentially, where one has an animation attached to it, though. If that happens, we cannot drop the animation when a _different_ property is written later on, but we do still have to update the whole value type. So, pass an additional argument in the relevant metacalls that declares the property we intended to change. Pick-to: 6.5 Fixes: QTBUG-54860 Change-Id: I3b6cad2d4707d30312cda98283928fd419c40345 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Retire the qt_parse_all_argumentsAmir Masoud Abdol2023-01-201-2/+2
| | | | | | Task-number: QTBUG-99238 Change-Id: Ia11c9cbd7c06347319ab3674ec0cd8da0214747e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-09-071-1/+1
| | | | | | | Task-number: QTBUG-105718 Change-Id: Id89ed14990804a5024183e75382cc539d4293da1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* CMake: Don't use PUBLIC_LIBRARIES for tests and test helpersAlexandru Croitor2022-07-281-1/+1
| | | | | Change-Id: I1cd769f85d5f82c43639d6787d98e536619249e6 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Add license headers to cmake filesLucie Gérard2022-07-081-0/+3
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I72c89a98c42bbc9234d8495e9e503bec81d11037 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-112-54/+4
| | | | | | | | | | | | 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>
* Replace uses of deprecated _qs with _s/QStringLiteralSona Kurazyan2022-04-291-1/+3
| | | | | | Task-number: QTBUG-101408 Change-Id: Ic925751b73f52d8fa5add5cacc52d6dd6ea2dc27 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* INTEGRITY: Fix some test cases from core/qml foldersKimmo Ollila2022-03-031-0/+3
| | | | | | | | | | | | | -Add dummy_imports.qml to TESTDATA -Let qmlimportscanner handle plugin import -Skip cases that depend on mounted filesystem Task-number: QTBUG-99123 Pick-to: 6.3 6.2 Change-Id: I99e21e423f2114c4c4ee1e24bdf9bb85af51baf7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Consolidate test helpers into private librariesMitch Curtis2021-09-132-5/+3
| | | | | | | | | | | | | | | | | | | | Previously each test would include and build sources from the shared folder. Now we make those sources a library, build it once, then have each test link to it instead. We also take the opportunity to move some helpers that qtquickcontrols2 had added into the quicktestutils library where it makes sense, and for the helpers that don't make sense to be there, move them into quickcontrolstestutils. We add the libraries to src/ so that they are internal modules built as part of Qt, rather than tests. That way we can use them in a standalone test outside of qtdeclarative. Task-number: QTBUG-95621 Pick-to: 6.2 Change-Id: I0a2ab3976fdbff2e4414df7bdc0808f16453b80a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Pass QMetaType by value rather than by ID in more placesUlf Hermann2021-06-091-22/+22
| | | | | | | | | | This saves us some ping-pong between the IDs and the QMetaTypes, and avoids possible ambiguities if multiple metatypes are registered for the same C++ type. Change-Id: I81cec94a9cd05d69927dc884f65574f0ab2ddc22 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Restrict types from unversioned imports only by major versionUlf Hermann2021-05-262-0/+28
| | | | | | | | | | | | | | | | 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 Pick-to: 6.1 Change-Id: I73f0f4fdaa00ac13cf91a4c21fd705c9dba070ec Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* QQmlAnyBinding: Honor interceptors if and only if requestedFabian Kosmale2021-05-121-0/+15
| | | | | | | | | | | | | When installing a binding on a property which is intercepted, we can either ignore or honor the interceptor (depending on whether the newly added binding's value should be intercepted or not). This was previously only implemented for QmlAbstractBinding based bindings. This patch adds support for QProperty based bindings, and a corresponding test. Change-Id: Ib0a63426aa4a137cb7a375405843f2b0a97845d0 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQmlPropertyValueInterceptor: Add binding interception supportFabian Kosmale2021-05-042-0/+55
| | | | | | | | | | | | | | | With the new property system, it is not enough to only intercept writes; we also need the ability to intercept calls to the bindable interface. This is done by adding a new bindable virtual method QQmlPropertyValueInterceptor. The default implementation does not do any interception at all for now. This allows us to keep the existing interceptors for now, and to port them step by step. Once all interceptors in Qt are ported, we can make the method in the interface pure virtual. Task-number: QTBUG-90999 Change-Id: I697658a1cd9a5204805a444e0d949213ba71b91c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Mark overrides in tests to silence compiler warningsVolker Hilsheimer2021-04-111-2/+2
| | | | | | Pick-to: 6.1 Change-Id: Ieed929dcd7b550a1dc365d34b6f20f2f0e2d057f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Mark overrides in tests, fix compiler warningsVolker Hilsheimer2021-04-011-3/+3
| | | | | | Change-Id: If753558d911e50a73e351a93eed2e4df3e6592c7 Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlMetaType: Remove qmlLists memberFabian Kosmale2021-03-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Instead of using a hashmap which maps a QML lists metatype to its list element's metatype, we can just store a pointer in the list metatype to the element metatype. Moreover, listType now returns a metatype. This is a preparation for converting enginePriv->rawMetaObjectForType(typeId) to metaType.metaObject() calls once we can actually retrieve the metaobject from QML metatypes. The QML metatype interface classes are moved into a header, so that Qt for Python can use the same classes. This does not affect types registered from C++, as those use a different mechanism. Task-number: QTBUG-88766 Task-number: QTBUG-82931 Task-number: QTBUG-87134 Change-Id: I330c2bbe4ac92072a333c001750f7504b56df478 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix some "can be marked override" warningsAndreas Buhr2021-02-231-1/+1
| | | | | | Change-Id: I13da0d085901314950c4fa0afb5853e183652e67 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Remove the qmake project filesFabian Kosmale2021-01-151-20/+0
| | | | | | | | | 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>
* Update tests to use new metaType systemDavid Skoland2020-11-021-11/+11
| | | | | | | | Change from the QVariant enum to the QMetaType enum and prefer typeId over userType where possible Change-Id: Ic89c55978d46cc23d23b8e9c82c475c0c220fae3 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix compile warnings from testsVolker Hilsheimer2020-10-221-3/+0
| | | | | | | | | | | Use streaming operators for debug/warnings to avoid qsizehint/int conflicts. Don't ignore return values from [[no_discard]] functions. Don't copy elements from containers that return references. Remove unused variables. Change-Id: I7a0bef94a5e828bd8facee0c625ec48c3d1f1bdb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-10-061-5/+5
| | | | | | | | Modify special case locations to use the new API as well. Task-number: QTBUG-86815 Change-Id: I3b964e3baf0cc7040830156dac30358ea1152801 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Remove qml statemachine plugin from qtdeclarativeKarsten Heimrich2020-08-231-21/+0
| | | | | | Task-number: QTBUG-80316 Change-Id: I584b699a1eec88117f343870bd2cd01075da64f7 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Compile with latest qtbase devFabian Kosmale2020-05-161-2/+2
| | | | | | | Get rid of QTextCodec in QQmlError and qcoloroutput.cpp and etc. Change-Id: I26ab81536d12eb0587d5d9ae747f6a379a4d0b12 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Update Apple platform defines after rename in qtbaseTor Arne Vestbø2020-03-171-2/+2
| | | | | Change-Id: Ia0a075e3199eab735f9b289873beeb8730ebc47e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-03-121-41/+57
|\ | | | | | | | | | | | | | | Conflicts: dependencies.yaml src/qml/qml/qqmlengine.cpp Change-Id: I6a73fd1064286f4a2232de85c2ce7f80452d4641
| * Adapt to the the new QMetaType changeOlivier Goffart2020-03-091-24/+24
| | | | | | | | | | | | Fixes: QTBUG-82453 Change-Id: I7e5682945a07c3af183becd3947a69568f139d16 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * Use QTypeRevision for all versions and revisionsUlf Hermann2020-02-031-17/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In many places we carry major and minor versions or revisions that are loosely coupled to minor versions. As the Qt minor version resets now, we need to handle these things more systematically. In particular, we need to add a "major" part to revisions. QTypeRevision can express the current major/minor pairs more efficiently and can also be used to add a major version to revisions. This change does not change the semantics, yet, but only replaces the types. Change-Id: Ie58ba8114d7e4c6427f0f28716deee71995c0d24 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Regenerate qtdeclarativeAlexandru Croitor2020-02-121-4/+2
| | | | | | | | | | | | | | Change-Id: I48d7fd306f3d1b161a8e73029282ee591b1ef612 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-01-291-16/+16
|\| | | | | | | | | | | | | Conflicts: dependencies.yaml Change-Id: Ie3e9dc62031a85e5e81cbdf04694b95159d49fca
| * Replace QVariant::type with QVariant::userTypeOlivier Goffart2020-01-171-16/+16
| | | | | | | | | | | | | | | | | | | | | | as type is going to be deprecated. This change was done automatically with the help of clazy. In addition, ColumnRoleMetadata was changed to take an int instead of a QVariant::Type Change-Id: Ibc02d7b52e7d931a56c19fdebc4788b5e6df2a39 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeLeander Beernaert2020-01-161-4/+6
|\| | | | | | | Change-Id: I0c5b939c70bdb91ccdf7068784308416dcaa5736
| * tst_qqmlmetatype.cpp: Avoid memory leaksUlf Hermann2020-01-101-4/+6
| | | | | | | | | | Change-Id: Ic4ff36e48a1ff5146ec44f58ed416fd24cce5330 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Regenerate all projects with new CMake API versionAlexandru Croitor2019-11-151-5/+5
| | | | | | | | | | | | Change-Id: Ie0db35f674137c229eaf049616f38f8e818f7092 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Regenerate remaining tests to be in syncAlexandru Croitor2019-11-151-15/+14
| | | | | | | | | | | | Change-Id: I200c8f58ad13bc1bc78409a3ce49348584ba5b51 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Add QtDeclarative Test CoverageLeander Beernaert2019-08-141-0/+66
|/ | | | | | | | | | | | | | | | | | | | | | All tests compile and run on a developer build. These tests are failing: tst_qqmlsqldatabase Fails due to missing sql driver tst_qqmlsqldatabase Fails in wip/qt6 tst_ququicklayouts Fails in wip/qt6 tst_flickableinterop Fails in wip/qt6 tst_qquickpinchandler Fails in wip/qt6 tst_qquickflickable Fails in wip/qt6 tst_qquickgridview Fails in wip/qt6 tst_qquickimage Fails due to missing jpeg plugin tst_qquicklistview Fails in wip/qt6 tst_qquicktext Fails in wip/qt6 tst_qquickcanvasitem Fails in wip/qt6 tst_scenegraph Fails due to missing jpeg plugin tst_TestFiltering Fails in wip/qt6 Change-Id: I4b9d69c118e23c095cb72ad5a67653fc30943bb1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-04-231-4/+4
|\ | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlmetatype.cpp Change-Id: Ieff61c076e46eb50a059c8b0210f7f4d7ce0cbcf
| * QML: Remove static attchedPropertyIds mapUlf Hermann2019-04-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the same object is available under two different names it should still have the same attached properties no matter which name you use. This was achieved by having a static map of metaobjects to attached property IDs that would always hold the first attached property ID registered for a given metaobject. This attached property ID was then used as key in the map of attached properties for the actual objects. The obvious downside to that is that we need a global static which gives us thread safety and static initialization (and destruction) problems. It turns out, all the attached properties are created by attached properties functions, registered by the user. Those functions only get the object to be amended as parameter. Therefore, no attached properties function can be registered for multiple attached properties on the same object as it wouldn't know which one to create for a given call. Thus, the whole ID dance is unnecessary as we can as well index the attached property objects by the function that created them. This nicely avoids creating two attached property objects for the same object and function and still makes the global static unnecessary. Fixes: QTBUG-75176 Change-Id: Ie8d53ef0a6f41c9b3d6b9d611cde1603a557901c Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-04-105-0/+110
|\| | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlmetatype.cpp src/qml/types/qqmlmodelsmodule.cpp Change-Id: Idc63689ba98d83a455283674f4b5cf3014473605
| * Allow enums in QQmlType to be set up in two separate passesUlf Hermann2019-03-285-0/+110
| | | | | | | | | | | | | | | | | | | | | | The baseMetaObject and the property cache can become available at different points in time. If we have initialized the enums before either of them is available we want to add the additional enums when the other one appears. Fixes: QTBUG-74677 Change-Id: I57276681a50b6c04181c6a29e736f2dc20632a0c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-02-253-0/+69
|\| | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlmetatype.cpp Change-Id: I517c001ea4eb0fdd8e469f9fffe5b7559a5b0795
| * QML: Pass type minor version when creating property dataUlf Hermann2019-02-213-0/+69
| | | | | | | | | | | | | | | | | | Depending on the type minor version recursive properties should be available or not. Check for that when resolving grouped properties. Fixes: QTBUG-33179 Change-Id: Id8f62befdc4a29d879710499e19d3d289bd18775 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Move QStringHash into its own fileUlf Hermann2019-02-061-1/+0
| | | | | | | | | | | | | | QHashedString and QStringHash are different things. Change-Id: Ifcac58ef41bf15dd6172fa0c42b86eca385c2ce0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | QML: Split qqmlmetatype{_p.h|.cpp} into multiple filesUlf Hermann2019-02-061-5/+5
|/ | | | | | | | Having all those classes in one big file promotes spaghetti code and makes the code unreadable. Change-Id: I3b6df93b9cfe1d97228771049b3054e78b868ea3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QQmlMetaType: Erase attached properties in dtorUlf Hermann2019-01-151-0/+39
| | | | | | | | | | Also, make it more obvious that the attachedPropertyIds are a static member of QQmlTypePrivate. Fixes: QTBUG-72972 Change-Id: If0a28e034dd46d7127993ed15aed11c7641d580e Reviewed-by: Harald Hvaal <harald.hvaal@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Show error message when type qmlRegisterType and friends failErik Verbruggen2018-06-261-9/+5
| | | | | | | | | When a type is registered through qmlRegisterType or similar functions, no error was shown. Task-number: QTBUG-68323 Change-Id: Iff44bf8744c67dba2fdd12c43aaee44a8e15364a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>