From 9995a2910d8a5f0317fe3adeb54f838b99ab31a8 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Mon, 3 Dec 2012 08:50:11 -0800 Subject: Add a method that allows registration of files to types There is currently no way in C++ to duplicate the functionality of a qmldir file in mapping QML files to versioned types in a module. This functionality would be useful both in cases where a separate qmldir file would be overkill, and for cases where the type mapping should be generated dynamically. Change-Id: I28d7898122c5556fcd7cf3476795bcf4bb288eab Reviewed-by: Christopher Adams --- src/declarative/qml/qdeclarativeimport.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/declarative/qml/qdeclarativeimport.cpp') diff --git a/src/declarative/qml/qdeclarativeimport.cpp b/src/declarative/qml/qdeclarativeimport.cpp index db062e47..14e69728 100644 --- a/src/declarative/qml/qdeclarativeimport.cpp +++ b/src/declarative/qml/qdeclarativeimport.cpp @@ -518,6 +518,9 @@ bool QDeclarativeImportsPrivate::add(const QDeclarativeDirComponents &qmldircomp if (QDeclarativeMetaType::isModule(uri.toUtf8(), vmaj, vmin)) versionFound = true; + //Load any type->file mappings registered for this uri + qmldircomponents << QDeclarativeMetaType::qmlComponents(uri.toUtf8(), vmaj, vmin); + if (!versionFound && qmldircomponents.isEmpty()) { if (errorString) { bool anyversion = QDeclarativeMetaType::isModule(uri.toUtf8(), -1, -1); -- cgit v1.2.3