aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml
Commit message (Collapse)AuthorAgeFilesLines
...
* | | QML: Delete plugin loaders on shutdownUlf Hermann2019-03-281-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | The StringRegisteredPluginMap owns its QPluginLoaders. Therefore, it should delete them in the end. ASAN complains if not. Change-Id: Iecd425e340d13db5cecd44bb123818e2c2a3b6a5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* | | Make sure we can delete value type providers in any orderUlf Hermann2019-03-281-36/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the null provider had to be deleted last as it would leave a dangling pointer in the global static. This meant that we could not delete any other value providers on shutdown as the deletion order between different Q_GLOBAL_STATICs is undefined. Task-number: QTBUG-74348 Change-Id: I12aab6ab9ec4c71b90af69c5f824e0c6686433f5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into HEADUlf Hermann2019-03-229-153/+205
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4compileddata_p.h src/qml/jit/qv4baselinejit.cpp src/qml/jit/qv4jithelpers.cpp src/qml/jsruntime/qv4lookup.cpp src/qml/jsruntime/qv4runtime.cpp src/qml/jsruntime/qv4runtimeapi_p.h src/qml/jsruntime/qv4vme_moth.cpp src/qml/qml/qqmltypemodule_p.h Change-Id: If28793e9e08418457a11fc2c5832f03cab2fcc76
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-03-218-152/+203
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qqmltypecompiler.cpp src/qml/compiler/qv4bytecodehandler.cpp src/qml/compiler/qv4codegen.cpp src/qml/compiler/qv4compileddata_p.h src/qml/compiler/qv4compiler.cpp src/qml/compiler/qv4instr_moth.cpp src/qml/compiler/qv4instr_moth_p.h src/qml/jit/qv4baselinejit.cpp src/qml/jit/qv4baselinejit_p.h src/qml/jsruntime/qv4function.cpp src/qml/jsruntime/qv4vme_moth.cpp Change-Id: I8fb4d6f19677bcec0a4593b250f2eda5ae85e3d2
| | * Accelerate lookup of singleton propertiesMichael Brasser2019-03-202-0/+64
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-69898 Change-Id: Id03ba543fa293da2690099c3e6f94b2725de562f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | * Remove dead compile time QML context/scope property and id object codeSimon Hausmann2019-03-203-114/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After enabling lookups in QML files, we can remove all the code that tries to deal with (type) compile time detection of access to id objects and properties of the scope/context object. This also allows removing quite a bit of run-time code paths and even byte code instructions. Task-number: QTBUG-69898 Change-Id: I7b26d7983393594a3ef56466d3e633f1822b76f4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | * Create import directory from intercepted URL, not orignial oneUlf Hermann2019-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | If the qmldir URL got intercepted, we should use the intercepted URL to get to the contents to be loaded. Fixes: QTBUG-73843 Change-Id: I51715575e767ed429a8237517f47196677409fe0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * Enable lookups in QMLSimon Hausmann2019-03-192-37/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main feature that needs to be implemented in order to enable lookups in QML files is to respect that the QObject wrapper has its own storage layer (meta-object properties). Lookups need to be able to index those when the base is a QObject. This is done by caching the property data and guarding the validity by comparing property cache pointers. The same lookup logic is also implemented for value type wrappers. OVerall there's more that can be done with lookups in meta-objects, for constant properties for example. For "global" lookups we have a safeguard in place that generates a LoadName instruction for property access that should end up in the qml context wrapper. So no changes are needed here at first, but the lookup in the QML context can be optimized in the future. The way of storing the property cache in the lookup itself trades ugliness on destruction against the creation of less internal classes. Another option would be to store the property cache in the internal class and let QObjectWrapper always transition via the property cache. Task-number: QTBUG-69898 Change-Id: I9c378c071acc6d7d4a34a2a76616f9594119d515 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * | Fix qdoc errorsFriedemann Kleint2019-03-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add ',' to enumerator and rearrange Q_QDOC #ifdefs, fixing: LOG Build & visit PCH for QtQuickDoc src/quick/scenegraph/coreapi/qsgnode.h:97:49: error: missing ',' between enumerators src/qml/qml/qqml.h:593:17: error: expected namespace name Change-Id: I4491c5885c5cdb8a156d9a7abcca5db4d68d1c2e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | Use QQmlRefCount for QQmlType(Private)Ulf Hermann2019-03-196-67/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-03-151-3/+5
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4codegen.cpp Change-Id: I604517d0948fb5056ce36cc104f13ac956fbcc24
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-03-131-3/+5
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4codegen.cpp src/qml/animations/qsequentialanimationgroupjob.cpp Change-Id: I8b76e509fd7c8599d4cef25181d790ee28edab54
| | * Doc: QQmlApplicationEngine::objectCreated() also signals errorsUlf Hermann2019-03-011-3/+5
| | | | | | | | | | | | | | | | | | Fixes: QTBUG-73298 Change-Id: Icb872963982f32baf6e9489f43d228041bcea2b8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-03-081-0/+4
|\| | | | | | | | | | | Change-Id: I7aa5284298990062fac9d9f1ab55d05f9b225ac9
| * | Doc: Promote use of ECMAScript modules over Qt.include()Ulf Hermann2019-03-041-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, mention that Qt.include() is deprecated. [ChangeLog][QtQml] Qt.include() is deprecated in favor of ECMAScript modules. Task-number: QTBUG-74068 Change-Id: Ia13e4f1577d86b869a9a1cd810a82ff0b27ea0cc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-02-258-47/+68
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlmetatype.cpp Change-Id: I517c001ea4eb0fdd8e469f9fffe5b7559a5b0795
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-02-225-18/+27
| |\| | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/quick/qquicktableview/tst_qquicktableview.cpp Change-Id: If3bf1abc23a59c458be0bb862d92f2edcb16b79f
| | * QML: Pass type minor version when creating property dataUlf Hermann2019-02-215-16/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * QQmlPropertyCache: support setting an explicit metaObject revisionRichard Moe Gustavsen2019-02-212-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | Only generate a warning when assigning null to incompatible propertiesUlf Hermann2019-02-221-29/+41
| | | | | | | | | | | | | | | | | | | | | | | | Such code used to work before and we should not break it without a proper deprecation procedure. Change-Id: I049caf6ae5cc06aa796b19eda858612935b8d674 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-02-214-9/+13
|\| | | | | | | | | | | Change-Id: Ie33d1c736992abcbde6568131374a7a7891f965c
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-204-9/+13
| |\| | | | | | | | | | Change-Id: I69c3e6610ff590d9c18f386fc17ed2e429b58d26
| | * Avoid unnecessary re-generation qml cache files in some circumstancesUlf Hermann2019-02-184-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The map of name IDs to resolved types so far is copied several times during compilation and different compile passes see different copies of it. Compile passes may add things to the map, and if they do that on copies that are inaccessible to other code, we get nondeterministic results. Furthermore all the copies and pointers are confusing and inefficient. Fixes: QTBUG-69340 Change-Id: I43ad3cbeeec34f90e05570eddc901fe8aa64c709 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * PropertCache: Don't pass Q_GADGET value types as integersUlf Hermann2019-02-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | We need to check for the IsGadget flag there. Fixes: QTBUG-73734 Change-Id: Ic4afd4215e6ed346bc40794d85397f0f262715e2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-02-163-5/+30
|\| | | | | | | | | | | Change-Id: I51cb42d253a83c0e6a76946c37cf1ff7c7cac150
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-141-2/+4
| |\| | | | | | | | | | Change-Id: I2842f4a8096c4555e29f08e65b88b77b841441cb
| | * Connect quit() and exit() signals with queued connectionsMichal Policht2019-02-131-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Class QQmlApplicationEngine connects QQmlApplicationEngine::quit() signal to QCoreApplication::quit() and QQmlApplicationEngine::exit() signal to QCoreApplication::exit(), but it does so with AutoConnection. This causes in some circumstances problems, which are described in Qt documentation (see QCoreApplication::exit()). This change modifies type of connections to queued connections. [ChangeLog][QtQml][QQmlApplicationEngine] QQmlApplicationEngine connects quit() and exit() signals with queued connections to avoid problems with AutoConnection, when connecting to QCoreApplication slots. Task-number: QTBUG-73649 Change-Id: Ib27738b5af2f879efee8862b1ca01613a2e8dc4e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * | Support loading images from content:/ URLs on AndroidNicolas Fella2019-02-132-3/+26
| | | | | | | | | | | | | | | | | | | | | | | | Patch 251038 adds support for content:/ URLs on Android, but to be able to load images from them this patch is needed. It copies the existing code for assets:/ URls Change-Id: Ic086da6396576553a9635dbbbb1fa12d45bd3f52 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* | | Make QQmlTypePrivate::name safe for usage from different threadsUlf Hermann2019-02-113-18/+14
| | | | | | | | | | | | | | | | | | | | | | | | 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-087-163/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Make QQmlRefCount usable for immutable typesUlf Hermann2019-02-081-13/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | refcounting should still be possible if the object is const. You can safely take and release references to const objects, after all. operator delete also works for const pointers. Therefore, make the refCount member mutable and declare addref() and release() as const. Additionally, drop the unused destroy() method and make the dtor protected for marginally more protection from accidental manual deletion. Plus, refcounted types should really not be copied or moved. Change-Id: I28fdc96c60b6ed5a056782568717c16b76234883 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Move registration functions from qqmlimport.cpp to qqmlmetatype.cppUlf Hermann2019-02-087-324/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These functions require the metatype data in multiple interdependent places. If they are executed concurrently data races are almost guaranteed. Move the functions to qqmlmetatype.cpp and keep the metatype mutex locked for their duration. Access to the internals of the metatype system also allows us to significantly simplify the logic. Additionally we can remove methods only used by those functions from the public interface of QQmlMetaType now. Task-number: QTBUG-73271 Change-Id: I1279259cca5cb5be63026d5b74f5d013e7a1ac5c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Add public methods to query and set allowed revisions of property cachesUlf Hermann2019-02-072-3/+9
| | | | | | | | | | | | | | | | | | | | | We should not poke around in the private objects for this. Change-Id: If7089848d8310700a5a84efb0ff9b753a7de1f97 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Tighten the interface of QQmlTypeModuleUlf Hermann2019-02-074-108/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No other classes really need direct access to QQmlTypeModulePrivate. Adding or removing types, as well as lookup of types needs to be protected by a mutex, as that can happen from multiple threads. However, we don't need to acquire the global type registration mutex in order to change the internals of some QQmlTypeModule. Rather, each type module gets its own mutex. The minimum and maximum versions as well as the "locked" property can be handled with atomic integers as they only ever move in one direction. The module and majorVersion properties are constant over the life time of the object. Therefore they don't need any locking. Task-number: QTBUG-73271 Change-Id: I23fe7dcaf521ccecaaaf19c1fb0436e109c42f03 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Remove debug code from QStringHashUlf Hermann2019-02-074-26/+0
| | | | | | | | | | | | | | | | | | | | | Now that we've split the classes, this doesn't work anymore. Change-Id: I9b18075db7895183f21045d199e8ac8b04245945 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Add a mutable iterator to QStringHashUlf Hermann2019-02-074-16/+58
| | | | | | | | | | | | | | | | | | | | | And use that in QQmlTypeModule to get rid of a const_cast. Change-Id: Ifbb39293b6f0e159355dd7780febba0eed149025 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Split QStringHash and QLinked(Multi)StringHash apartUlf Hermann2019-02-074-238/+301
| | | | | | | | | | | | | | | | | | | | | | | | The plain QStringHash can have a mutable iterator. The linked one can not. We never use a non-linked MultiStringHash. Change-Id: I69b66f7952e6e47b79c0995f389e6219744dfc76 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | QQmlMetaType: Only provide access to the singleton through the lockUlf Hermann2019-02-061-109/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The singleton is hidden behind a struct that is only transparent for a smart pointer that acquires the lock on construction and releases it on destruction. Task-number: QTBUG-73271 Change-Id: Ifec9c853498edb8fb71411170171d999d51258f6 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Move QStringHash into its own fileUlf Hermann2019-02-0610-984/+1091
| | | | | | | | | | | | | | | | | | | | | 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-0622-1927/+2744
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Remove outdated methodUlf Hermann2019-02-041-2/+0
| | | | | | | | | | | | | | | Change-Id: I457dc9384653e973e96cb393c45285afe215808d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | QML: Split propertyCache into multiple filesUlf Hermann2019-02-0122-924/+1620
|/ / | | | | | | | | | | | | I want to be able to read the code. Change-Id: I063143ff63b0a476d783c892e1d328e7f5133fab Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-01-292-20/+53
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/masm/yarr/YarrJIT.cpp src/qml/compiler/qv4instr_moth.cpp src/quick/handlers/qquicksinglepointhandler_p.h src/quick/handlers/qquicktaphandler.cpp src/quick/items/context2d/qquickcontext2d.cpp Done-With: Ulf Hermann <ulf.hermann@qt.io> Change-Id: I109453131f9f0a05316ae37c7d6ed1edc8c0f9d4
| * QQmlNotifier: Always keep the isNotifying flag when updating senderPtrUlf Hermann2019-01-232-20/+53
| | | | | | | | | | | | | | | | | | | | | | When the sender gets deleted we still want to retain the flag that tells us that the notifier is currently active. Otherwise we can miss the error message about synchronously deleting objects while signal handlers are in progress. Task-number: QTBUG-73013 Change-Id: I8abba9b492327c15963d1875841c6822f345a89e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-01-225-19/+28
|\| | | | | | | | | | | | | | | Conflicts: .qmake.conf tests/auto/quick/qquickpathview/tst_qquickpathview.cpp Change-Id: Ic1f5e219a255d0613f7654368a5ce3eccb8f0ee9
| * Documentation: Start using the \nullptr macroFriedemann Kleint2019-01-213-10/+8
| | | | | | | | | | | | Task-number: PYSIDE-903 Change-Id: I0c4640eb20157673eabb131e8834e79cbbf95d5c Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * QQmlMetaType: Erase attached properties in dtorUlf Hermann2019-01-151-4/+12
| | | | | | | | | | | | | | | | | | | | 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>
| * Fix crash with qt.qml.binding.removal.info=trueNils Jeisecke2019-01-141-5/+8
| | | | | | | | | | | | | | | | | | For some bindings (qsTr) no actual javascript function exists and the debug output causes a null pointer access. Fixes: QTBUG-73009 Change-Id: I896fd2afd680dc5dee544a0c46ade6746f6727d8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | QML: Special case null as binding typeUlf Hermann2019-01-211-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | This gives us the opportunity to map the JavaScript null to QVariant's concept of isNull(). [ChangeLog][QML] Assigning JavaScript null to incompatibly typed properties generates a compile error now, rather than a runtime error. Fixes: QTBUG-72098 Change-Id: I72fd1c30d84128c774230eaaea10455b2a0e064c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QML: Consider all possible metatypes when looking for attached propsUlf Hermann2019-01-211-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | metaObjectToType is in fact a MultiHash. There can be more than one QML type associated with a given metaobject. Therefore, in order to find the attached properties we need to iterate them. This highlights a different problem: If you register the same metaobject under different QML names and define different attached properties for each, you will get random results here. That, however, is a problem of the public qmlAttachedPropertiesObject function, which doesn't take a parameter for the registered name of the type. Change-Id: I0eb9618114029ef5000d8eb12691b7f8de485121 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>