aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmltype_p_p.h
Commit message (Collapse)AuthorAgeFilesLines
* QML: Allow singleton types to be extendedUlf Hermann2020-11-021-0/+2
| | | | | | | | | It seems we never stated that singletons can not be extended in our documentation. Therefore this is technically a bug fix and doesn't need separate documentation. Change-Id: I7877289bd5a52ecf709f80ba1975137981ec65f0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use factory functions and ctors for creating value typesUlf Hermann2020-10-021-0/+1
| | | | | | | | | | As you can extend value types with QML_EXTENDED we may as well allow a factory function in the extended type. Furthermore, if the original type allows construction from QJSValue, we may just use that. In turn, we can get rid of the value type providers now. Change-Id: I9124ea47537eab6c33d7451080ab2fff942eaa7b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* V4: Rewrite qv4sequenceobject based on QMetaSequenceUlf Hermann2020-10-021-0/+3
| | | | | | | | | | This avoids the template explosion and makes the mechanism extendable. You can now register additional anonymous sequential containers. Fixes: QTBUG-71574 Task-number: QTBUG-82443 Change-Id: I5b9ed9af1533a3b7df8fc5bb37bbb73b8304e592 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add userdata callback to qml registrationMaximilian Goldstein2020-07-101-1/+2
| | | | | | | This is needed in order to remove PySide2's qml type limit. Change-Id: I331d9e31574a744eb9085222d58ea8a8789e0e31 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQmlTypePrivate: do not abuse volatile for atomicFabian Kosmale2020-06-091-4/+6
| | | | | | | | | | Instead of using volatile, use proper atomics for thread safe access. Moreover, we don't gain anything by using bitfields here, as we have space for 4 bools due to alignment reasons anyway. Therefore using bools does not create any overhead. Change-Id: I390acd935656efcb20265ddb67fa0059f3f18118 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Adapt to the the new QMetaType changeOlivier Goffart2020-03-091-2/+2
| | | | | | Fixes: QTBUG-82453 Change-Id: I7e5682945a07c3af183becd3947a69568f139d16 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use QTypeRevision for all versions and revisionsUlf Hermann2020-02-031-3/+2
| | | | | | | | | | | | | | 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>
* Long live QML inline componentsFabian Kosmale2020-01-231-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtQml] It is now possible to declare new QML components in a QML file via the component keyword. They can be used just as if they were declared in another file, with the only difference that the type name needs to be prefixed with the name of the containing type outside of the file were the inline component has been declared. Notably, inline components are not closures: In the following example, the output would be 42 // MyItem.qml Item { property int i: 33 component IC: Item { Component.onCompleted: console.log(i) } } // user.qml Item { property int i: 42 MyItem.IC {} } Fixes: QTBUG-79382 Change-Id: I6a5ffc43f093a76323f435cfee9bab217781b8f5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Retrieve the attached properties base type without recursionUlf Hermann2019-11-181-0/+12
| | | | | | | | | This is probably faster and avoids the deprecation warnings stemming from deprecated functions calling themselves recursively. Task-number: QTBUG-80040 Change-Id: I2f65aad3bc7f85b7a7de66d3e76dac1233a58db8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Optimize enum setupUlf Hermann2019-09-101-1/+21
| | | | | | | | | | If we have already set up the enums from a property cache or a metaobject, respectively, we can see that from the flags. Retrieving the composite property cache is expensive and we can skip it in that case. Task-number: QTBUG-77237 Change-Id: I63f5e1ca0fc166ec927754bdf5d166b2ce8ff0f6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-04-231-1/+0
| | | | | | | Conflicts: src/qml/qml/qqmlmetatype.cpp Change-Id: Ieff61c076e46eb50a059c8b0210f7f4d7ce0cbcf
* Move propertyCache-by-minor-version into QQmlMetaTypeDataUlf Hermann2019-04-181-11/+0
| | | | | | | | | | | | Ths data structure should only be accessed when protected by the metatype data lock. In fact we don't access it from anywhere else. To make that more obvious, move it to the right place. This allows us to eliminate some const_cast and poking around in QQmlTypePrivate from the outside. Change-Id: I16ffd240b9504b9c00010bdb2d17b05c8196fe8a Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-04-101-1/+2
| | | | | | | | Conflicts: src/qml/qml/qqmlmetatype.cpp src/qml/types/qqmlmodelsmodule.cpp Change-Id: Idc63689ba98d83a455283674f4b5cf3014473605
* Use QQmlRefCount for QQmlType(Private)Ulf Hermann2019-03-191-4/+4
| | | | | | | | | | | | | As we already have an implementation of refcounting, we can just use that intead of inventing another one. This also gives us nice move ctors and operators. Also, use const pointers to QQmlTypePrivate where possible. This exposes quite some nastiness that needs to be fixed in follow-up commits: All the mutable members of QQmlTypePrivate are unsafe for multithreaded use. Change-Id: I3be8f2c53d86e06ffa80c8df8830473fe6d1d91d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Make QQmlTypePrivate::name safe for usage from different threadsUlf Hermann2019-02-111-0/+3
| | | | | | | | There is hardly a point in setting this lazily. We always set uri and elementName together anyway. Change-Id: I5f9f00ee72d78fd8cf66413e81c8d88db1f8a436 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Eliminate excessive friendlyness of QQmlTypeUlf Hermann2019-02-081-2/+0
| | | | | | | | | | | | QQmlMetaTypeData does need to be exposed to the QQmlType ctors. Rather, we can use factory functions to create the QQmlTypePrivate objects. The static attachedPropertyIds should really be part of QQmlMetaTypeData and access to them should be protected by the lock. Task-number: QTBUG-73271 Change-Id: I154a3842fab03a02c710901a20afd1652364808d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Move QStringHash into its own fileUlf Hermann2019-02-061-1/+1
| | | | | | | 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-0/+160
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>