aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlpropertycache
Commit message (Collapse)AuthorAgeFilesLines
* Remove the qmake project filesFabian Kosmale2021-01-151-11/+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>
* QQmlPropertyCache: Remove unused copyAndAppend overloadFabian Kosmale2020-12-031-3/+3
| | | | | | | Original-patch-by: Lars Knoll <lars.knoll@qt.io> Task-number: QTBUG-88765 Change-Id: I85dad61a1c3ade29137be9870ce8af726be81a28 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Update MetaType things in testsDavid Skoland2020-11-041-1/+1
| | | | | | | Also fix some minute errors. Change-Id: I1815224a6efdd7e619dfe5a5911d8b1166a3b3c8 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-10-061-3/+3
| | | | | | | | 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>
* Blacklist various failing testsShawn Rutledge2020-09-251-0/+2
| | | | | | | | | | | | tst_qqflickable::nestedStopAtBounds, nestedSliderUsingTouch tst_QQuickMouseArea::preventStealing, nestedFlickableStopAtBounds tst_QQuickMultiPointTouchArea::inFlickable2, inFlickableWithPressDelay tst_QQuickPathView::nestedinFlickable, touchButtonOnFlickable, touchGrabCausesMouseUngrab tst_qqmlpropertycache::derivedGadgetMethod Task-number: QTBUG-86729 Change-Id: Ie11a50c25f90fde2636b05a72f51640643b33dec Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Restrict qmlRegisterTypesAndRevisions to major version givenUlf Hermann2020-07-162-0/+30
| | | | | | | | | | | We should not register any revisions larger than the given major version as that allows importing an incomplete module, as the version-less import. Typically the offending version is pulled in via some QML_FOREIGN and only the types derived from that foreign class are available in the higher major version. Change-Id: I186fb010d704bea514cefff9f66eb58186df5c91 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* PropertyCache: Fix resolution of forbidden QObject methodsUlf Hermann2020-04-282-0/+83
| | | | | | | | | Despite best intentions the code still hid methods of gadgets when those were derived from other gadgets. Pick-to: 5.15 Change-Id: I787300b2a22d6557608772d218e73b9af6f79652 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Encapsulate QQmlContextDataUlf Hermann2020-03-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This class is not a private detail of QQmlContext. And it is incredibly hard to see who owns what in there. Let's add some civilization ... We enforce refcounting for QQmlContextData across the code base, with two exceptions: 1. QQmlContextPrivate may or may not own its QQmlContextData. 2. We may request a QQmlContextData owned by its parent QQmlContextData. For these two cases we keep flags in QQmlContextData and when the respective field (m_parent or m_publicContext) is reset, we release() once. Furthermore, QQmlContextData and QQmlGuardedContextData are moved to their own files, in order to de-spaghettify qqmlcontext_p.h and qqmlcontext.cpp. When the QQmlEngine is deleted, any QQmlComponents drop their object creators now, in order to release any context data held by those. Before, the context data would be deleted, but the object creators would retain the dangling pointer. [ChangeLog][QML][Important Behavior Changes] QQmlContext::baseUrl() does what the documentation says now: It prefers explicitly set baseUrls over compilation unit URLs. Only if no baseUrl is set, the CU's URL is returned. It used to prefer the CU's URL. Change-Id: Ieeb5dcb07b45d891526191321386d5443b8f5738 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-2/+3
|\ | | | | | | | | | | | | | | Conflicts: dependencies.yaml src/qml/qml/qqmlengine.cpp Change-Id: I6a73fd1064286f4a2232de85c2ce7f80452d4641
| * Process major versions as part of Q_REVISIONUlf Hermann2020-02-131-1/+1
| | | | | | | | | | | | | | | | Retrieve the major version from the meta object revisions and use them to register types and generate qmltypes files. Change-Id: I35da8963457660d1a49ba9063574e1a68057a7ba Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * Use QTypeRevision for all versions and revisionsUlf Hermann2020-02-031-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/cmakeLeander Beernaert2020-01-161-12/+28
|\| | | | | | | Change-Id: I0c5b939c70bdb91ccdf7068784308416dcaa5736
| * Make QtQml work with the latest changes in qtbaseLars Knoll2020-01-141-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Adjust the code to work with the new QString and QVector data structures that have inlined size and data pointers. Fix a large bunch of compiler warnings from QFlags. Update dependencies for qtbase and qtsvg Change-Id: Iba237aed90c140b822e0cf501b9fb7156ec27c2d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * tst_qqmlpropertycache: Avoid memory leaksUlf Hermann2020-01-021-11/+25
| | | | | | | | | | | | | | | | All the property caches come with one initial ref. The QQmlRefPointers need to adopt that one. Change-Id: I27ae2226c39888e2e5d99f593c2857456c048f2c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Regenerate all projects with new CMake API versionAlexandru Croitor2019-11-151-3/+3
| | | | | | | | | | | | Change-Id: Ie0db35f674137c229eaf049616f38f8e818f7092 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Regenerate testsAlexandru Croitor2019-11-141-11/+2
| | | | | | | | | | | | Change-Id: I67a6c8f1659e7b471a4fcb92a2699292cf4eea81 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2019-10-144-0/+28
|\| | | | | | | | | | | | | Removed dependencies.yaml because we don't use it yet in wip/cmake. Fixed conflict in qmlcachegen.cpp. Change-Id: Ie1060c737bee1daa85779903598e5b6d5020d922
| * Force creation of metaobjects for top level objects and componentsUlf Hermann2019-09-134-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We want those to be different types, even if they don't add any properties, signals etc. Otherwise you can cross-assign objects of components defined in different files. Fully-dynamic types, such as QQmlPropertyMap are still an exception to this. We need to use the original meta object so that you can still dynamically add properties to any derived types. Therefore, all types derived from QQmlPropertyMap are in fact just aliases of each other. Also, types which aren't addressable from the outside don't get their own meta object. Types are addressable if they live in files and the file name starts with an uppercase character. Otherwise there is no way to refer to the component from anywhere else in QML. Fixes: QTBUG-76021 Change-Id: I96a01fdad13e50e4705520fec46f2b3373e0c365 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Add QtDeclarative Test CoverageLeander Beernaert2019-08-141-0/+49
|/ | | | | | | | | | | | | | | | | | | | | | 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>
* Remove unused includes of qv8engine_p.hUlf Hermann2019-04-091-1/+0
| | | | | Change-Id: Ic135a863581d29a3afb9c6c7f070d2630b3913b4 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-02-221-0/+21
|\ | | | | | | | | | | | | Conflicts: tests/auto/quick/qquicktableview/tst_qquicktableview.cpp Change-Id: If3bf1abc23a59c458be0bb862d92f2edcb16b79f
| * QQmlPropertyCache: support setting an explicit metaObject revisionRichard Moe Gustavsen2019-02-211-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When creating a QQmlPropertyCache for a QMetaObject, there were currently no way to specify which revision to use. Normally this is not needed, since when creating property caches for types declared in QML, the correct revision would be filled in later, based on the import version found in the QML file. But sometimes we need to create a QQmlPropertyCache for a QMetaObject created in C++, that has no associated QML file and import version. And if that meta object has revisioned properties, we need to specify which revision of the meta object the cache should represent. Otherwise, the revision would just be 0, which means that revisoned properties would not be found by the V4 runtime later. As an example, QQmlAdaptorModel has a set of classes that wraps various models (QAIM, arrays, etc). When a new delegate item is created by a view, an instance of a model class will be created as well (from C++). This instance will be set as context object for the delegate item, enabling properties such as index, row, column and model roles. But since row and column should a revision (currently they don't), we need to be able to specify that the property cache should have a revision that matches the import version of the view. That way, we can ensure that they don't shadow any existing row and column properties that might exist in the application from before, and as such, cause regressions. This patch will add an extra argument to the constructor that lets you specify which revision of the QMetaObject to use. Task-number: QTBUG-70031 Change-Id: I1c245a0c8b6f071e35865966fedc97f2839cd2f3 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-152-0/+51
|\| | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlpropertycache.cpp Change-Id: Ie7727499700b85cc0959ef3abb30d55dc728b659
| * PropertCache: Don't pass Q_GADGET value types as integersUlf Hermann2019-02-142-0/+51
| | | | | | | | | | | | | | | | We need to check for the IsGadget flag there. Fixes: QTBUG-73734 Change-Id: Ic4afd4215e6ed346bc40794d85397f0f262715e2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QQmlPropertyCache: Add test that reads and writes short enumsUlf Hermann2019-01-032-1/+31
|/ | | | | | | | This is to guard against any problems from casting those to int and back. Change-Id: I740a5250158ce47195ab04d42d967ff9c82bf9bd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QML: Use all available type information to find enum typesUlf Hermann2018-11-193-1/+83
| | | | | | | | | | | | Using the metatype system we can identify most enumeration types statically, without lookup by name. Only if we get UnknownType we have to do a name based lookup. As the name based lookup only checks enums that either belong to the global Qt namespace or the surrounding class, the type based lookup gives better results. Task-number: QTBUG-58454 Change-Id: Id6bd748f37838249defb4c5b2a7628eadc1a8341 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Clean up manual reference of QQmlTypeData and QQmlPropertyCacheSimon Hausmann2018-04-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | We have a few places in the type loader where we do adventurous manual reference counting, where getType() returns a raw pointer that has been addref()'ed and then sometimes somehow we call release() later. Commit 0b394e30bba4f6bb7e6f7dbe5585a2e15aa0f21d is an example of where this can easily go wrong. As a consequence and also in preparation for future work on the type loader, this patch starts replacing the manual reference counting there. Changing the return type from QQmlTypeData *getType() to a QQmlRefPointer<> itself is not sufficient though, as the implicit operator T*() will still allow the caller to store the result as a raw pointer. Therefore this patch removes the "unsafe" implicit extraction operator. As a result of that change, other types that are sometimes stored in QQmlRefPointer are also affected and their usage needs to be adapted to QQmlRefPointer usage or manual raw pointer extraction with .data(). Change-Id: I18fd40634047f13196a237f4e6766cbef3bfbea2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-3/+3
| | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Move the engine pointer from the property cache to the VME meta objectLars Knoll2017-08-021-12/+6
| | | | | | | | | This is where it belongs, and it makes the PropertyCache independent of the engine used. Task-number: QTBUG-61536 Change-Id: I21c2674ee3e2895abd2418764d140b154b47b868 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QML: Make all fields in QQmlPropertyRawData privateErik Verbruggen2016-08-101-36/+36
| | | | | | | | And add accessors. This makes it easier later on to change the storage of the fields. Change-Id: I21163668ac83a7d52f398981baf3c27ef161c177 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add a checksum to QQmlPropertyCacheSimon Hausmann2016-08-011-0/+38
| | | | | | | | By running an md5 hash over the meta-object data and string tables this will allow us to detect changes to meta-objects and invalidate QML disk caches. Change-Id: I15b92de4cdf0cb525281b86e1c7b8ba0b11347a0 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add a function to QQmlPropertyCache to calculate the meta-object sizesSimon Hausmann2016-08-011-37/+124
| | | | | | | | This will be used later for calculating checksums of the meta-object data. Change-Id: Iba925eae298cbfc7b89196f4dd6fb2854ce75e2e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Updated license headersJani Heikkinen2016-01-201-17/+12
| | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I04760a0801837cfc516d1c7c02d4f503f6bb70b6 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Remove CONFIG += parallel_test.Friedemann Kleint2015-09-051-1/+0
| | | | | | | The keyword no longer has a meaning for the new CI. Change-Id: I699f2881e291cce02a6a608a8710638886e38daa Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove QT_DISABLE_DEPRECATED_BEFORE=0 from tests not using deprecated API.Friedemann Kleint2015-09-031-1/+0
| | | | | Change-Id: I691b8ddff60b5f16f06d32b379c76e87f44f84a9 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Hold a pointer to the QV4::ExecutionEngine in the property cacheLars Knoll2015-08-191-6/+13
| | | | | | | This makes more sense than a pointer to the QQmlEngine. Change-Id: Ic6037b0df63b6cf1585539bc3ac78822f0e69d02 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* Prepare for QQmlPropertyCache to become available in QJSEngineSimon Hausmann2014-12-291-3/+3
| | | | | | | | | The cache is seemingly tied to QQmlEngine, but it isn't. A lot of times a QQmlEngine parameter is unnecessarily dragged around and the engine member is option as well as it turns out. Change-Id: Iffd2a5046e9785249689ebfcbc8a0ad509f76aea Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Fix compilation with built-in v4vm JS engineSimon Hausmann2013-04-151-1/+1
| | | | | Change-Id: Ieda9267e296acf6392a5461f4cfb9233a7a409a0 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Restrict v8 property lookup to the execution contextMatthew Vogt2012-08-271-36/+41
| | | | | | | | | | | | | When resolving property names, only properties known to the current context of execution should be available. If a property name has been overriden by a component extension, code executing in the context of the base component should resolve the property name to the property available inside the base component or its bases. Task-number: QTBUG-24891 Change-Id: I9687cc28e108226d5a939627a901c8254344b598 Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Set the Qt API level to compatibility mode in all tests.Thiago Macieira2012-08-011-0/+1
| | | | | | | | | | Qt 5.0 beta requires changing the default to the 5.0 API, disabling the deprecated code. However, tests should test (and often do) the compatibility API too, so turn it back on. Task-number: QTBUG-25053 Change-Id: I6988c2360e9d88916311374a0c910bfc5b607439 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Enable tst_qqmlpropertycacheChris Adams2012-07-121-6/+3
| | | | | | | | | Due to the lazy metaobject initialization change, the property cache's append method is now private. Instead, it offers a copyAndAppend method which the test should use. Change-Id: I1279eb997832244593aa11d5644d14b31ea68dd2 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-242-0/+289
Symbols beginning with QDeclarative are already exported by the quick1 module. Users can apply the bin/rename-qtdeclarative-symbols.sh script to modify client code using the previous names of the renamed symbols. Task-number: QTBUG-23737 Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66 Reviewed-by: Martin Jones <martin.jones@nokia.com>