aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlproperty.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QtQml: Re-allow change signals in QQmlPropertyUlf Hermann2024-02-261-3/+3
| | | | | | | | | | Amends commit a1ce0596e517e84913b14ab23422137c95b8c785. Pick-to: 6.7 Task-number: QTBUG-109548 Change-Id: I476c1798bb9a125264375e6fb0829e1357d99770 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QQmlProperty: fix signal handler warningFabian Kosmale2024-01-301-6/+7
| | | | | | | | | It should only be emitted if we find a signal of that name. Pick-to: 6.7 6.6 6.5 Fixes: QTBUG-118710 Change-Id: I15cf92c03dd7b46805e5a69078ca2beb6c862293 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Remove QQmlTypeLoader from QQmlImportUlf Hermann2024-01-111-4/+4
| | | | | | | | | The type loader belongs to the engine and we must not store it in engine-independent data structures. We do want the import cache to be stored in the type registry, though (in a separate change). Change-Id: I2828f5098b27bf1fc96852fc2bd160db44b109e7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlProperty: Don't unnecessarily call QStringView::toString()Ulf Hermann2023-10-111-6/+5
| | | | | | | All those methods can use QStringView. Change-Id: Ic79ab024ca933e7a21017ee498eb2d486b49ae6e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlProperty: Clean up includesUlf Hermann2023-09-051-23/+23
| | | | | | | Change-Id: I1cf9042dde2164dc445e20dcc6336ff08803ee01 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
* QQmlProperty: Accept badly capitalized signal handler namesUlf Hermann2023-09-051-7/+23
| | | | | | | | | ... but warn about them. Apparently we did accept them prior to 6.4. Fixes: QTBUG-116576 Pick-to: 6.5 6.6 Change-Id: If890db85f5a8d71c0bcdfaf646ee9f01765a0b3c Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Replace signal name manipulations with QQmlSignalNamesSami Shalayel2023-08-151-30/+13
| | | | | | | | | | | | | | | Remove custom implementations found in qqmljs* and use the static helper methods from qqmlsignalnames_p.h instead. This sometimes requires to move some code around to avoid bugs with property that do not have letters in their name. Add a warning in the JS implementation of the SignalSpy.qml that the used heuristic might fail on certain signal names. Add tests in in tst_qqmllanguage to see if the property change handlers work correctly for weird names. Change-Id: I4dc73c34df7f77f529511fa04ab5fcc5385b59fc Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlProperty: Allow QVariantList as QObject* containerUlf Hermann2023-06-151-0/+5
| | | | | | | | | This happens if we convert a JavaScript list to a variant. Pick-to: 6.5 6.6 Fixes: QTBUG-114458 Change-Id: Iea206fd9dfd89f1512104431864b3294170bdbda Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Value types: Prefer assigning bindings instead of convertingFabian Kosmale2023-05-091-10/+12
| | | | | | | | | | | | When we're assigning a QJSValue to a value type property, we must first check whether it is a binding created by Qt.binding. In that case, we should directly set that binding up. Going through the conversion code path might not necessarily fail, but might instead yield nonsense. Pick-to: 6.5 Fixes: QTBUG-113472 Change-Id: If91e0843f0caf36c96b4c811b9ce8076adfc984f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Only signal list variable assignment onceMikolaj Boc2023-04-221-4/+16
| | | | | | | | | | Lists are internally cleared and each element is pushed to the back from the source list in QML. Use nonsignaling operations for clear and push and activate manually having performed the operations. Fixes: QTBUG-112208 Change-Id: I1a995905f3fa758e4cc8c39b8576db668d84a067 Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* QML: Allow some more backing types for enumsFabian Kosmale2023-04-121-7/+2
| | | | | | | | | Task-number: QTBUG-112180 Done-with: Fabian Kosmale <fabian.kosmale@qt.io> Change-Id: I48a2a696d3424ab1d8b9e693a92361a978ad70e9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* Avoid duplicate value type creationUlf Hermann2023-02-241-7/+8
| | | | | | | | | | | We can actually produce an uninitialized but pre-allocated QVariant using QVariant::Private. Using the new in-place construction support in QMetaObject, we can minimize the amount of copying necessary for value types. Fixes: QTBUG-108789 Change-Id: I6b748794a6adbf6558e1e3086eab80fcfb3154a0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QtQml: Fix clashes with windows.h definesFriedemann Kleint2023-02-221-3/+3
| | | | | | | Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: I92d269c1fa66ee2fe903554f17e3207d51d56b60 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Remove superfluous Q_DECLARE_METATYPEFabian Kosmale2023-02-081-6/+0
| | | | | | | | | It breaks unity builds, and declaring metatypes outside of the actual class that uses them is generally a bad idea. Pick-to: 6.5 Change-Id: I0106667f6075aabc2fa3c9e5271d21b64f41e4c1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QML: Allow more conversions between different listsUlf Hermann2023-01-261-32/+63
| | | | | | | | | | You should be able to assign any list of QObjects to any other list of QObjects. Pick-to: 6.5 Fixes: QTBUG-108155 Change-Id: I6ddf0b49f7248ad56cc9560d217f3ea316c648a8 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* QML: Fix interceptors on value types ignoring fast changesUlf Hermann2023-01-251-11/+15
| | | | | | | | | | | | | | | | | | | | | | 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>
* QML: Allow converting any object list to QQmlListPropertyUlf Hermann2023-01-251-17/+32
| | | | | | | | | We can use QSequentialIterable for this. Pick-to: 6.5 Fixes: QTBUG-110438 Change-Id: I7e82d0f089c9bb9eab46be46dedc2db3726e64b0 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
* QML: Re-allow assigning QVariantList to arbitrary other listsUlf Hermann2023-01-041-33/+40
| | | | | | | | | | | | | | | | | Since we can assign a QVariant to any other singular value, we should be able to do the same with lists of QVariant. This ability was lost when we stopped converting QVariantList to JS array but rather started to express it as QV4::Sequence. As a drive-by, generalize the messy code that allows assigning singular values to lists. This should also just work for any singular value and any kind of list. Fixes: QTBUG-109584 Pick-to: 6.4 6.5 Change-Id: Icab1dceff332c5fc4fae9e7e8a8b5fde9f0b0ea9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Port from container::count() and length() to size()Marc Mutz2022-10-071-8/+8
| | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8: auto QtContainerClass = anyOf( expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o), expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o)); makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container', with the extended set of container classes recognized. Change-Id: Idb1f75dfe2323bd1d9e8b4d58d54f1b4b80c7ed7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Allow more options for creating value types from JS objectsUlf Hermann2022-09-241-32/+78
| | | | | | | | | | | | | | | | | | | | We allow value types to be created 1. by calling Q_INVOKABLE constructors 2. by setting their values from properties of a JS object Both have to be opted into by setting a class info. If opted into, these options override the existing methods. When a a type can be created by setting its properties, that implies you can also initialize it using an invokable constructor. However, when given a JS object, the properties method is used. We keep this internal and undocumented for now. As the last try (the create(QJSValue) methods and QJSValue ctors) was not that stellar, let's first wait a bit and see if we're getting it right this time around. Fixes: QTBUG-106480 Change-Id: I767230924afcba032d501846cc3263dad57b7bf0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QtQml: Remove unused includes in qml, final partSemih Yavuz2022-09-141-5/+2
| | | | | | | | | | | | | | Drop unnecessary includes detected by clangd-iwyu. Add new includes due to the transitive includes. Also, some of the includes were detected as unused even if they were actually in use. In those cases, use angular brackets instead of "" which deceives the tool not to complain. Affected subfolders: JsRuntime, Qml Fixes: QTBUG-106473 Change-Id: I483da15d42a8e3ce6cd3b654909665fff3075d6b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Allow resetting value type propertiesUlf Hermann2022-06-241-43/+103
| | | | | | | | Fixes: QTBUG-60909 Change-Id: I589c0b30cead134f746def2ffc853ff43d2598e0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-111-38/+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>
* Generalize role selection mechanism from QQuickComboBoxUlf Hermann2022-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | | We can have QQmlDelegateModel pick specific roles from model items. That can easily be done for variant maps, variant hashes, objects and gadgets. We would like to do it for anything that has a QMetaAssociation, but as we cannot get to the original type at that place, it's currently not possible. The special case about variant maps with exactly one item in variant lists is clearly insane and therefore not included in the generalization. This requires some cleanup in the QQmlGadgetPointerWrapper. Passing the wrapper itself to QMetaProperty::read() has always been a rather obscure way of reading from the gadget. Pick-to: 6.3 Fixes: QTBUG-102983 Change-Id: I84ecef980783e7137aa4d77070ddce47b6ead260 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Qml: includemocsMarc Mutz2022-04-291-0/+2
| | | | | | | | | | | | Including moc files directly into their classes' TU tends to improve codegen and enables extended compiler warnings, e.g. about unused private functions or fields. Pick-to: 6.3 6.2 5.15 Task-number: QTBUG-102948 Change-Id: Ie39c60a19ba562affe6bd52ba68b38db95298cf3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Generalize QQmlAbstractBinding::isValueTypeProxy()Ulf Hermann2022-04-251-3/+2
| | | | | | | | | Instead of a bool we can just return an enum of the actual kind. This way all the checks become more readable. Furthermore, we can eliminate a dynamic_cast without sacrificing readability. Change-Id: I8a38687f9b796cd47196a6ab0385624c737e4435 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Make most QQmlPropertyData constUlf Hermann2022-03-141-7/+7
| | | | | | | You really should not mess with that after creating the property cache. Change-Id: I070200772475bb67f539dbbd85a298020b14ca79 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QML: Allow named lists of value typesUlf Hermann2022-01-281-28/+39
| | | | | | | | | | | | | | | | | | | | | | | | We register QList<T> as sequential container type for any value type T we get. This way we can always find a type to use for list<t> with t being a value type. The metatypes are shuffled around so that we have an easier time associating a type with its list and vice versa. As QQmlPropertyData's isQList flag denotes both QQmlListProperty<T> and QList<T> now, we need to use QMetaType::IsQmlList more often. Conversely, any name given to extra sequential containers registered via QML_SEQUENTIAL_CONTAINER is explicitly ignored now. As you can do list<foo> for any type foo now, there is not much of a point in having further named container registrations for the same type. It would just make things more complicated. Mind that the name had already been ignored before, just not explicitly. [ChangeLog][QtQml] You can now use lists of value types in QML. For example a property of type list<int> will hold a list of integers. Task-number: QTBUG-82443 Change-Id: I7bee61cee3963dae5d231bf59f70b8012984371d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Avoid ping-pong between plain pointers and QQmlRefPointerUlf Hermann2022-01-251-7/+12
| | | | | | | | | | | | | | | We want to deal in QQmlRefPointer as much as possible. In particular, assigning nullptr to a QQmlRefPointer triggers the creation of an empty QQmlRefPointer and the assignment of that one. Provide a reset() method to do this in a cleaner way. In turn, make QQmlGuardedContextData::reset() private. It's really dangerous and should not be called from outside. setContextData() is safer but may do additional work. The only place from where reset() was previously called in its public capacity is probably dead code, though. Change-Id: Idb72e255dbfad6e5dd963dc76d719bb9edc10471 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlProperty: Prohibit ID lookup on explicitly given objectUlf Hermann2022-01-211-1/+2
| | | | | | | | | | If an object is given, we should only use that object. Amends commit 21f15ede606df028479335c64c333db5fb1bb3f7. Pick-to: 6.3 Task-number: QTBUG-100110 Change-Id: I51c0a44750c31984ba4937fb1cd2405dd93fcc19 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Move propertyCache- and metaObject-related functions into QQmlMetaTypeUlf Hermann2022-01-181-19/+6
| | | | | | | | | | | | That's where the data resides. This allows us to lock the mutex only once for all those methods, and it makes a large number of engine pointers unnecessary. Finally, we can now find the element type of a QQmlListProperty without supplying an engine. Change-Id: If1ae8eafe8762a112d1ca06f9c92ab8a727d1bda Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Move QJSEnginePrivate::cache() to QQmlMetaTypeUlf Hermann2022-01-181-1/+1
| | | | | | | | | It is just in line with the other propertyCache() methods, and should be treated the same way. The comment made no sense anymore. This allows us to drop more engine pointers. Change-Id: I2e9b479b555c7f771b619e4693d59cbfcf244df6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Don't crash when accessing QVariant data pointerVolker Hilsheimer2021-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | The write method is called with a QVariant, and even though the property might be of a QObject type, the variant might not contain a QObject. So accessing the variant data directly via QVariant::constData and static_cast'ing the void* to QObject* is not safe. Add an explicit check before accessing. An alternative would be to at least Q_ASSERT that the result of the cast and a QVariant::value call is the same, which would then not introduce any performance penalty in release builds. However, users use release-builds of qml and Qt tooling to write QML, and we writing wrong QML code should not crash then either. Include a test case that segfaults without the fix. Pick-to: 6.2 Fixes: QTBUG-98367 Change-Id: Ib3ae82d03c9b2df6251ee88d5bd969dd4f796a41 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QQmlTypeNameCache: Unify querying for typesUlf Hermann2021-12-031-5/+12
| | | | | | | | | | | | | | | Template all of the code and make sure the different query variants do the same work. There is no reason not to query the namespaced imports if we are passed a different string type as parameter. If we want to skip the namespaced imports, that is a separate parameter. This needs to be picked to 6.2 as precondition for fixing AOTCompiledContext::initLoadAttachedLookup. We need to pass a QQmlImport::RecursionRestriction when querying by QHashedStringRef. Pick-to: 6.2 Change-Id: I98aecc7775036728668cc93f550aa73fdefafe9a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Drop Qt3 supportIvan Tkachenko2021-11-261-5/+1
| | | | | | | | | | | | This conditional code clearly hasn't been compiled in a while, as QVariant::{types} were ported over to QMetaType namespace, so that QVariant::CString is not even a thing anymore. More over, CString is not a part of new the API, and QVariant::QVariant(const char *val) constructor creates a deep copy of val into a QString. Task-number: QTBUG-98650 Change-Id: I93606d1718bdf6d6fd72c333dd9e8fffd60fa4c5 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix life cycle methods of various types related to QQmlBindUlf Hermann2021-11-121-4/+1
| | | | | | | | | | | Code checker complains about the absence of move ctors and operators. While we're at it, make ctors default where possible, do not use const rvalue refs, add noexcept where possible, properly disable moving and copying of QQmlBindEntryContent, and inline the null check of QV4::PersistentValueStorage::free(). Change-Id: I11b6511f39f3d84479dbacee7f3e3552a5fb2b5a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Do not crash on self-assignment of QQmlPropertyUlf Hermann2021-11-101-6/+2
| | | | | | | | | If you had a QQmlPropertyPrivate with only one reference, assigning its QQmlProperty to itself would delete the QQmlPropertyPrivate. Pick-to: 5.15 6.2 Change-Id: I73f8e6df63af09d3f43a101749a5800153499057 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlProperty: Add flexibility to initProperty()Ulf Hermann2021-10-271-46/+126
| | | | | | | | | | | | | | | | | | | | Using private API, you can now construct a QQmlProperty from an unknown object by passing a dot-separated string that starts with an ID. You can also have a plain signal name (without "on") as the last part of the name. Both variants are optional and have to be enabled via flags. In Qt7, we should clean up the "on" vs. plain signal name affair. For now we can't because everything expects the "on". Constructing properties from ID'd objects can only be done in specific places. Therefore this has to be manually enabled. Furthermore, you can now create properties, not only signals, from plain QMetaObjects. This is enabled unconditionally because there was no reason for this to not work before. Change-Id: I9ff764130b70f9d023ab63d492f83290e8e87ef3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Improve type conversions from/to QJSValueUlf Hermann2021-10-201-0/+17
| | | | | | | | | We can convert everything into a QJSValue if we have an engine and we can save a binding function in a QVariant by wrapping it into QJSValue. Change-Id: I48e7c13f3f744f1c50bf673b427fe9331250f313 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QML engine: Resolve URLs on property assignment when given an env varFabian Kosmale2021-10-061-16/+34
| | | | | | | | | | | | | This is a partial (and manual) revert of 0a1e4cc7ec7548f6273befff9cdddb0bc7a58961. We still do not intercept during property assignment, but relative URLs get resolved in the current context if QML_COMPAT_RESOLVE_URLS_ON_ASSIGNMENT is set. Pick-to: 6.2 Task-number: QTBUG-95587 Change-Id: Ib2955541d2626fd26d3886b33f8ba0c2f940779b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Pass QMetaType by value rather than by ID in more placesUlf Hermann2021-06-091-39/+48
| | | | | | | | | | 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>
* Rename QQmlMetaType::metaObjectForMetaType into metaObjectForValueTypeUlf Hermann2021-06-081-3/+3
| | | | | | | | It really only works for value types and it's not intended to do anythign else. The name should reflect this. Change-Id: Ib73bf7e9655971f7826fe72145e2d2fab363363c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlProperty: Implement DontRemoveBinding support for QPropertyFabian Kosmale2021-05-121-0/+19
| | | | | | | | | | | | | | | | | The animation system currently relies on being able to write to properties through the meatobject system without breaking their bindings. This patch ensures that the DontRemoveBinding flag is honoured for QProperty based bindings, too. It is implemented by setting the private stick flag on the binding before doing the write and then removing it again after the write is done. This roundabout approach is necessary as the BindableInterface does not expose the setValueBypassingBindings functionality, and simply writing to the propertyDataPtr would prove disastrous in the case of QObjectCompatProperty. Fixes: QTBUG-91689 Change-Id: Ife1afb9c94190f1c4e9658a7193aba6dbdaa281f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQmlMetaTypeData: Purge custom string convertersFabian Kosmale2021-03-301-8/+0
| | | | | | | | | Those were never exposed anyway. color, date, etc. are handled by the less generic converters in qqmlstringconverters_p.h. Change-Id: I43a94acda08344de742440dd3b956a7077096b11 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@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>
* QQmlEnginePrivate: remove functions that only forward to QQmlMetaTypeFabian Kosmale2021-03-051-3/+3
| | | | | | | | | | As a drive-by, remove metatype-id to metatype conversion in qqmlproperty.cpp Task-number: QTBUG-82931 Change-Id: I88511bdc103bfb507b6c4401af103e0aec13894f Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQmlProperty: add method to query bindabilityFabian Kosmale2021-03-041-0/+15
| | | | | | | | | Internal for now. Task-number: QTBUG-91000 Change-Id: I744277426d5038de9266ca0adf7d281230fb4a7c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* QQmlProperty: document propertyMetaTypeFabian Kosmale2021-02-191-2/+9
| | | | | | Pick-to: 6.1 Change-Id: Ida75d35fb4eced20b206caf3bc247c734679cf10 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQmlProperty: use new findAlias target overloadFabian Kosmale2021-02-191-4/+4
| | | | | Change-Id: If72f0aa2b194dc3fd48ed2679c2229748e5a5001 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQmlPropertyPrivate::findAliasTarget: add more ergonomic overloadFabian Kosmale2021-02-191-0/+8
| | | | | | | | This simply calls the old overload for now and documents what the function does. Change-Id: I14f69dbc1610814c1cd714180d5b4a791e97de3a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>