diff --git a/codecompletion/tests/qmlcompletiontest.cpp b/codecompletion/tests/qmlcompletiontest.cpp
index cef0254..a0583d1 100644
--- a/codecompletion/tests/qmlcompletiontest.cpp
+++ b/codecompletion/tests/qmlcompletiontest.cpp
@@ -90,6 +90,10 @@ const CompletionParameters QmlCompletionTest::prepareCompletion(const QString& i
     ReferencedTopDUContext topContext = DUChain::self()->waitForUpdate(IndexedString(filename),
                                                                        KDevelop::TopDUContext::AllDeclarationsAndContexts);
 
+    while (!ICore::self()->languageController()->backgroundParser()->isIdle()) {
+        QTest::qWait(500);
+    }
+
     Q_ASSERT(topContext);
 
     // Now that it has been parsed, the file can be deleted (this avoids problems
@@ -219,6 +223,9 @@ void QmlCompletionTest::testContainsDeclaration_data()
         "  %INVOKE\n"
         " }\n"
         "}\n" << "onTest: parent.%CURSOR" << "prop" << true;
+
+    // This declaration must be in QtQuick 2.2 but not 2.0 (tested in testDoesNotContainDeclaration)
+    QTest::newRow("qml_module_version_2.2") << "import QtQuick 2.2\n Item { id: a\n %INVOKE }" << "%CURSOR" << "OpacityAnimator" << true;
 }
 
 void QmlCompletionTest::testDoesNotContainDeclaration()
@@ -245,6 +252,9 @@ void QmlCompletionTest::testDoesNotContainDeclaration_data()
     // When providing completions for script bindings, don't propose script bindings
     // for properties/signals of the surrounding components
     QTest::newRow("qml_script_binding_not_surrounding") << "Item { property int foo; Item { %INVOKE } }" << "%CURSOR" << "foo" << false;
+
+    // Some QML components are only available in specific versions of their module
+    QTest::newRow("qml_module_version_2.0") << "import QtQuick 2.0\n Item { id: a\n %INVOKE }" << "%CURSOR" << "OpacityAnimator" << true;
 }
 
 }
diff --git a/duchain/declarationbuilder.cpp b/duchain/declarationbuilder.cpp
index d0f8772..c183674 100644
--- a/duchain/declarationbuilder.cpp
+++ b/duchain/declarationbuilder.cpp
@@ -27,7 +27,6 @@
 #include <language/duchain/types/typeutils.h>
 #include <language/duchain/declaration.h>
 #include <language/duchain/aliasdeclaration.h>
-#include <language/duchain/namespacealiasdeclaration.h>
 #include <language/duchain/duchainlock.h>
 #include <language/duchain/classdeclaration.h>
 
@@ -728,20 +727,24 @@ void DeclarationBuilder::declareComponentInstance(QmlJS::AST::ExpressionStatemen
     closeDeclaration();
 }
 
-void DeclarationBuilder::declareExports(QmlJS::AST::ExpressionStatement *exports,
-                                        ClassDeclaration* classdecl)
+DeclarationBuilder::ExportLiteralsAndNames DeclarationBuilder::exportedNames(QmlJS::AST::ExpressionStatement* exports)
 {
+    ExportLiteralsAndNames res;
+
     if (!exports) {
-        return;
+        return res;
     }
 
     auto exportslist = QmlJS::AST::cast<QmlJS::AST::ArrayLiteral*>(exports->expression);
 
     if (!exportslist) {
-        return;
+        return res;
     }
 
-    // Declare a new class that has the exported name, but whose type is the original component name
+    // Explore all the exported symbols for this component and keep only those
+    // having a version compatible with the one of this module
+    QSet<QString> knownNames;
+
     for (auto it = exportslist->elements; it && it->expression; it = it->next) {
         auto stringliteral = QmlJS::AST::cast<QmlJS::AST::StringLiteral *>(it->expression);
 
@@ -750,36 +753,63 @@ void DeclarationBuilder::declareExports(QmlJS::AST::ExpressionStatement *exports
         }
 
         // String literal like "Namespace/Class version".
-        QString exportname = stringliteral->value.toString().section(' ', 0, 0).section('/', -1, -1);
+        QStringList nameAndVersion = stringliteral->value.toString().section('/', -1, -1).split(' ');
+        QString name = nameAndVersion.at(0);
+        QString version = (nameAndVersion.count() > 1 ? nameAndVersion.at(1) : QLatin1String("1.0"));
+
+        if (!knownNames.contains(name)) {
+            knownNames.insert(name);
+
+            // Verions of a given name are given in ascending order. This module
+            // "declares" the export only if it has the version in which the export
+            // appeared for the first time. We come here if the symbol appears for
+            // the first time in the exports list, and this check keeps it only
+            // if this module has the correct version
+            if (version == m_session->moduleVersion()) {
+                res.append(qMakePair(stringliteral, name));
+            }
+        }
+    }
+
+    return res;
+}
+
+
+void DeclarationBuilder::declareExports(const ExportLiteralsAndNames& exports,
+                                        ClassDeclaration* classdecl)
+{
+    DUChainWriteLocker lock;
+
+    // Create the exported versions of the component
+    for (auto exp : exports) {
+        QmlJS::AST::StringLiteral* literal = exp.first;
+        QString name = exp.second;
         StructureType::Ptr type(new StructureType);
 
-        {
-            DUChainWriteLocker lock;
+        injectContext(currentContext()->parentContext());   // Don't declare the export in its C++-ish component, but in the scope above
+        ClassDeclaration* decl = openDeclaration<ClassDeclaration>(
+            QualifiedIdentifier(name),
+            m_session->locationToRange(literal->literalToken)
+        );
+        closeInjectedContext();
 
-            injectContext(currentContext()->parentContext());   // Don't declare the export in its C++-ish component, but in the scope above
-            ClassDeclaration* decl = openDeclaration<ClassDeclaration>(
-                QualifiedIdentifier(exportname),
-                m_session->locationToRange(stringliteral->literalToken)
-            );
-            closeInjectedContext();
+        // The exported version inherits from the C++ component
+        decl->setKind(Declaration::Type);
+        decl->setClassType(ClassDeclarationData::Class);
+        decl->clearBaseClasses();
+        type->setDeclaration(decl);
 
-            // The exported version inherits from the C++ component
-            decl->setKind(Declaration::Type);
-            decl->setClassType(ClassDeclarationData::Class);
-            decl->clearBaseClasses();
-            type->setDeclaration(decl);
+        addBaseClass(decl, classdecl->indexedType());
 
-            addBaseClass(decl, classdecl->indexedType());
+        // Open a context for the exported class, and register its base class in it
+        decl->setInternalContext(openContext(
+            literal,
+            DUContext::Class,
+            QualifiedIdentifier(name)
+        ));
+        registerBaseClasses();
+        closeContext();
 
-            // Open a context for the exported class, and register its base class in it
-            decl->setInternalContext(openContext(
-                stringliteral,
-                DUContext::Class,
-                QualifiedIdentifier(exportname)
-            ));
-            registerBaseClasses();
-            closeContext();
-        }
         openType(type);
         closeAndAssignType();
     }
@@ -794,12 +824,19 @@ bool DeclarationBuilder::visit(QmlJS::AST::UiImport* node)
     QString uri;
 
     while (part) {
-        uri.append(part->name.toString() + '.');
+        if (!uri.isEmpty()) {
+            uri.append('.');
+        }
+
+        uri.append(part->name.toString());
         part = part->next;
     }
 
+    // Version of the import
+    QString version = m_session->symbolAt(node->versionToken);
+
     // Import the file corresponding to the URI
-    ReferencedTopDUContext importedContext = m_session->contextOfModule(uri + "qml");
+    ReferencedTopDUContext importedContext = m_session->contextOfModule(QString("%1_%2.qml").arg(uri, version));
 
     if (importedContext) {
         DUChainWriteLocker lock;
@@ -822,20 +859,48 @@ bool DeclarationBuilder::visit(QmlJS::AST::UiObjectDefinition* node)
         return DeclarationBuilderBase::visit(node);
     }
 
-    // Declare the component subclass
     RangeInRevision range(m_session->locationToRange(node->qualifiedTypeNameId->identifierToken));
     QString baseclass = node->qualifiedTypeNameId->name.toString();
 
+    // "Component" needs special care: a component that appears only in a future
+    // version of this module, or that already appeared in a former version, must
+    // be skipped because it is useless
+    ExportLiteralsAndNames exports;
+
     if (baseclass == QLatin1String("Module")) {
         // Don't build any declaration or context for Modules, but explore them.
         // This way, their declarations are in the global scope, ready to be
         // imported by other files.
         m_skipEndVisit.push(true);
         return true;            // Don't declare anything for the module, but explore it
+    } else if (baseclass == QLatin1String("Component")) {
+        QmlJS::AST::Statement* statement = QmlJS::getQMLAttribute(node->initializer->members, QLatin1String("exports"));
+
+        exports = exportedNames(QmlJS::AST::cast<QmlJS::AST::ExpressionStatement *>(statement));
+
+        if (exports.count() == 0 &&
+            (statement || !m_session->moduleVersion().endsWith(QLatin1String(".0")))) {
+            // No exported version of this component. The second part of the
+            // condition allows non-exported components to still be processed
+            // in the .0 revision of the module (so that QObject, not exported
+            // in QML, is still accessible and declared in QtQuick 1.0 and 2.0)
+            m_skipEndVisit.push(true);
+            return false;
+        }
     }
 
+    // Declare the component subclass
     declareComponentSubclass(node->initializer, range, baseclass);
 
+    // If we had a component with exported names, declare these exports
+    if (baseclass == QLatin1String("Component")) {
+        ClassDeclaration* classDecl = currentDeclaration<ClassDeclaration>();
+
+        if (classDecl) {
+            declareExports(exports, classDecl);
+        }
+    }
+
     m_skipEndVisit.push(false);
     return DeclarationBuilderBase::visit(node);
 }
@@ -866,14 +931,6 @@ bool DeclarationBuilder::visit(QmlJS::AST::UiScriptBinding* node)
         // Instantiate a QML component: its type is the current type (the anonymous
         // QML class that surrounds the declaration)
         declareComponentInstance(QmlJS::AST::cast<QmlJS::AST::ExpressionStatement *>(node->statement));
-    } else if (bindingName == QLatin1String("exports")) {
-        // Declare sub-classes of the current QML component: they are its exported
-        // class names
-        ClassDeclaration* classDecl = currentDeclaration<ClassDeclaration>();
-
-        if (classDecl && classDecl->classType() == ClassDeclarationData::Interface) {
-            declareExports(QmlJS::AST::cast<QmlJS::AST::ExpressionStatement *>(node->statement), classDecl);
-        }
     }
 
     // Use ExpressionVisitor to find the signal/property bound
diff --git a/duchain/declarationbuilder.h b/duchain/declarationbuilder.h
index dc132d9..12716cb 100644
--- a/duchain/declarationbuilder.h
+++ b/duchain/declarationbuilder.h
@@ -47,6 +47,8 @@ protected:
     using Visitor::visit;
     using Visitor::endVisit;
 
+    typedef QList<QPair<QmlJS::AST::StringLiteral*, QString>> ExportLiteralsAndNames;
+
     // Functions
     template<typename Decl>
     void declareFunction(QmlJS::AST::Node* node,
@@ -101,7 +103,8 @@ protected:
                                   const KDevelop::RangeInRevision& range,
                                   const QString& baseclass);
     void declareComponentInstance(QmlJS::AST::ExpressionStatement *expression);
-    void declareExports(QmlJS::AST::ExpressionStatement *exports,
+    ExportLiteralsAndNames exportedNames(QmlJS::AST::ExpressionStatement *exports);
+    void declareExports(const ExportLiteralsAndNames& exports,
                         KDevelop::ClassDeclaration* classdecl);
 
     // UI
diff --git a/duchain/parsesession.cpp b/duchain/parsesession.cpp
index 9ef32a0..65d2114 100644
--- a/duchain/parsesession.cpp
+++ b/duchain/parsesession.cpp
@@ -100,7 +100,7 @@ IndexedString ParseSession::url() const
 }
 
 QString ParseSession::moduleName() const
- {
+{
     return m_baseNameWithoutVersion;
 }
 
diff --git a/qmlplugins/Qt.labs.folderlistmodel.qml b/qmlplugins/Qt.labs.folderlistmodel_1.0.qml
similarity index 99%
rename from qmlplugins/Qt.labs.folderlistmodel.qml
rename to qmlplugins/Qt.labs.folderlistmodel_1.0.qml
index ee1e58e..5a3bf9d 100644
--- a/qmlplugins/Qt.labs.folderlistmodel.qml
+++ b/qmlplugins/Qt.labs.folderlistmodel_1.0.qml
@@ -1,4 +1,4 @@
-import Builtins1 1.0
+import QtQuick 1.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/Qt.labs.gestures.qml b/qmlplugins/Qt.labs.gestures_1.0.qml
similarity index 98%
rename from qmlplugins/Qt.labs.gestures.qml
rename to qmlplugins/Qt.labs.gestures_1.0.qml
index 675eeb1..3a68bac 100644
--- a/qmlplugins/Qt.labs.gestures.qml
+++ b/qmlplugins/Qt.labs.gestures_1.0.qml
@@ -1,5 +1,4 @@
-import Builtins1 1.0
-import Builtins2 1.0
+import QtQuick 1.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/Qt.labs.particles.qml b/qmlplugins/Qt.labs.particles_1.0.qml
similarity index 98%
rename from qmlplugins/Qt.labs.particles.qml
rename to qmlplugins/Qt.labs.particles_1.0.qml
index 9150529..2814b18 100644
--- a/qmlplugins/Qt.labs.particles.qml
+++ b/qmlplugins/Qt.labs.particles_1.0.qml
@@ -1,5 +1,4 @@
-import Builtins1 1.0
-import Builtins2 1.0
+import QtQuick 1.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/Qt.labs.settings.qml b/qmlplugins/Qt.labs.settings_1.0.qml
similarity index 95%
rename from qmlplugins/Qt.labs.settings.qml
rename to qmlplugins/Qt.labs.settings_1.0.qml
index e3cc0f7..89229ac 100644
--- a/qmlplugins/Qt.labs.settings.qml
+++ b/qmlplugins/Qt.labs.settings_1.0.qml
@@ -1,4 +1,4 @@
-import Builtins1 1.0
+import QtQuick 2.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/Qt.labs.shaders.qml b/qmlplugins/Qt.labs.shaders_1.0.qml
similarity index 97%
rename from qmlplugins/Qt.labs.shaders.qml
rename to qmlplugins/Qt.labs.shaders_1.0.qml
index d357277..fd024c9 100644
--- a/qmlplugins/Qt.labs.shaders.qml
+++ b/qmlplugins/Qt.labs.shaders_1.0.qml
@@ -1,5 +1,4 @@
-import Builtins1 1.0
-import Builtins2 1.0
+import QtQuick 1.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/QtAudioEngine.qml b/qmlplugins/QtAudioEngine_1.0.qml
similarity index 99%
rename from qmlplugins/QtAudioEngine.qml
rename to qmlplugins/QtAudioEngine_1.0.qml
index 1416717..8b02fd1 100644
--- a/qmlplugins/QtAudioEngine.qml
+++ b/qmlplugins/QtAudioEngine_1.0.qml
@@ -1,4 +1,4 @@
-import Builtins1 1.0
+import QtQuick 2.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/QtBluetooth.qml b/qmlplugins/QtBluetooth_5.0.qml
similarity index 99%
copy from qmlplugins/QtBluetooth.qml
copy to qmlplugins/QtBluetooth_5.0.qml
index 9cef5cb..2d6daa1 100644
--- a/qmlplugins/QtBluetooth.qml
+++ b/qmlplugins/QtBluetooth_5.0.qml
@@ -1,4 +1,4 @@
-import Builtins1 1.0
+import QtQuick 2.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/QtBluetooth.qml b/qmlplugins/QtBluetooth_5.2.qml
similarity index 99%
rename from qmlplugins/QtBluetooth.qml
rename to qmlplugins/QtBluetooth_5.2.qml
index 9cef5cb..ebc9d05 100644
--- a/qmlplugins/QtBluetooth.qml
+++ b/qmlplugins/QtBluetooth_5.2.qml
@@ -1,4 +1,4 @@
-import Builtins1 1.0
+import QtBluetooth 5.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/QtMultimedia.qml b/qmlplugins/QtMultimedia_5.0.qml
similarity index 99%
rename from qmlplugins/QtMultimedia.qml
rename to qmlplugins/QtMultimedia_5.0.qml
index 0dbf3b7..7a87cb4 100644
--- a/qmlplugins/QtMultimedia.qml
+++ b/qmlplugins/QtMultimedia_5.0.qml
@@ -1,6 +1,4 @@
-import Builtins1 1.0
-import QtAudioEngine 1.0
-import QtBluetooth 1.0
+import QtQuick 2.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/QtNfc.qml b/qmlplugins/QtNfc_5.0.qml
similarity index 99%
copy from qmlplugins/QtNfc.qml
copy to qmlplugins/QtNfc_5.0.qml
index e49a811..b574e45 100644
--- a/qmlplugins/QtNfc.qml
+++ b/qmlplugins/QtNfc_5.0.qml
@@ -1,4 +1,4 @@
-import Builtins1 1.0
+import QtQuick 2.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/QtNfc.qml b/qmlplugins/QtNfc_5.2.qml
similarity index 99%
rename from qmlplugins/QtNfc.qml
rename to qmlplugins/QtNfc_5.2.qml
index e49a811..b90d34a 100644
--- a/qmlplugins/QtNfc.qml
+++ b/qmlplugins/QtNfc_5.2.qml
@@ -1,4 +1,4 @@
-import Builtins1 1.0
+import QtNfc 5.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/QtPositioning.qml b/qmlplugins/QtPositioning_5.0.qml
similarity index 99%
copy from qmlplugins/QtPositioning.qml
copy to qmlplugins/QtPositioning_5.0.qml
index 30b203f..039c849 100644
--- a/qmlplugins/QtPositioning.qml
+++ b/qmlplugins/QtPositioning_5.0.qml
@@ -1,4 +1,4 @@
-import Builtins1 1.0
+import QtQuick 2.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/QtPositioning.qml b/qmlplugins/QtPositioning_5.2.qml
similarity index 99%
rename from qmlplugins/QtPositioning.qml
rename to qmlplugins/QtPositioning_5.2.qml
index 30b203f..0bae7f6 100644
--- a/qmlplugins/QtPositioning.qml
+++ b/qmlplugins/QtPositioning_5.2.qml
@@ -1,4 +1,4 @@
-import Builtins1 1.0
+import QtPositioning 5.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/QtQuick.Controls.qml b/qmlplugins/QtQuick.Controls_1.0.qml
similarity index 99%
copy from qmlplugins/QtQuick.Controls.qml
copy to qmlplugins/QtQuick.Controls_1.0.qml
index 6045273..3f0edfe 100644
--- a/qmlplugins/QtQuick.Controls.qml
+++ b/qmlplugins/QtQuick.Controls_1.0.qml
@@ -1,4 +1,4 @@
-import Builtins1 1.0
+import QtQuick 2.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/QtQuick.Controls.qml b/qmlplugins/QtQuick.Controls_1.1.qml
similarity index 99%
rename from qmlplugins/QtQuick.Controls.qml
rename to qmlplugins/QtQuick.Controls_1.1.qml
index 6045273..be4741b 100644
--- a/qmlplugins/QtQuick.Controls.qml
+++ b/qmlplugins/QtQuick.Controls_1.1.qml
@@ -1,4 +1,4 @@
-import Builtins1 1.0
+import QtQuick.Controls 1.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/QtQuick.Dialogs.qml b/qmlplugins/QtQuick.Dialogs_1.0.qml
similarity index 99%
copy from qmlplugins/QtQuick.Dialogs.qml
copy to qmlplugins/QtQuick.Dialogs_1.0.qml
index 5541c5c..be0d2c5 100644
--- a/qmlplugins/QtQuick.Dialogs.qml
+++ b/qmlplugins/QtQuick.Dialogs_1.0.qml
@@ -1,4 +1,4 @@
-import Builtins1 1.0
+import QtQuick 2.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/QtQuick.Dialogs.qml b/qmlplugins/QtQuick.Dialogs_1.1.qml
similarity index 99%
rename from qmlplugins/QtQuick.Dialogs.qml
rename to qmlplugins/QtQuick.Dialogs_1.1.qml
index 5541c5c..9244e40 100644
--- a/qmlplugins/QtQuick.Dialogs.qml
+++ b/qmlplugins/QtQuick.Dialogs_1.1.qml
@@ -1,4 +1,4 @@
-import Builtins1 1.0
+import QtQuick.QtQuick.Dialogs 1.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/QtQuick.Layouts.qml b/qmlplugins/QtQuick.Layouts_1.0.qml
similarity index 99%
rename from qmlplugins/QtQuick.Layouts.qml
rename to qmlplugins/QtQuick.Layouts_1.0.qml
index 2263401..3299d3e 100644
--- a/qmlplugins/QtQuick.Layouts.qml
+++ b/qmlplugins/QtQuick.Layouts_1.0.qml
@@ -1,4 +1,4 @@
-import Builtins1 1.0
+import QtQuick 2.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/QtQuick.LocalStorage.qml b/qmlplugins/QtQuick.LocalStorage_2.0.qml
similarity index 96%
rename from qmlplugins/QtQuick.LocalStorage.qml
rename to qmlplugins/QtQuick.LocalStorage_2.0.qml
index cbf8a4d..8429b17 100644
--- a/qmlplugins/QtQuick.LocalStorage.qml
+++ b/qmlplugins/QtQuick.LocalStorage_2.0.qml
@@ -1,4 +1,4 @@
-import Builtins1 1.0
+import QtQuick 2.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/QtQuick.Particles.qml b/qmlplugins/QtQuick.Particles_2.0.qml
similarity index 99%
rename from qmlplugins/QtQuick.Particles.qml
rename to qmlplugins/QtQuick.Particles_2.0.qml
index 711c7a2..2041505 100644
--- a/qmlplugins/QtQuick.Particles.qml
+++ b/qmlplugins/QtQuick.Particles_2.0.qml
@@ -1,4 +1,4 @@
-import Builtins1 1.0
+import QtQuick 2.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/QtQuick.PrivateWidgets.qml b/qmlplugins/QtQuick.PrivateWidgets_1.0.qml
similarity index 99%
copy from qmlplugins/QtQuick.PrivateWidgets.qml
copy to qmlplugins/QtQuick.PrivateWidgets_1.0.qml
index 9947c2b..c744c20 100644
--- a/qmlplugins/QtQuick.PrivateWidgets.qml
+++ b/qmlplugins/QtQuick.PrivateWidgets_1.0.qml
@@ -1,5 +1,4 @@
-import Builtins1 1.0
-import QtQuick.Dialogs 1.0
+import QtQuick 2.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/QtQuick.PrivateWidgets.qml b/qmlplugins/QtQuick.PrivateWidgets_1.1.qml
similarity index 99%
rename from qmlplugins/QtQuick.PrivateWidgets.qml
rename to qmlplugins/QtQuick.PrivateWidgets_1.1.qml
index 9947c2b..446ea40 100644
--- a/qmlplugins/QtQuick.PrivateWidgets.qml
+++ b/qmlplugins/QtQuick.PrivateWidgets_1.1.qml
@@ -1,5 +1,4 @@
-import Builtins1 1.0
-import QtQuick.Dialogs 1.0
+import QtQuick.PrivateWidgets 1.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/QtQuick.Window.qml b/qmlplugins/QtQuick.Window_2.0.qml
similarity index 99%
copy from qmlplugins/QtQuick.Window.qml
copy to qmlplugins/QtQuick.Window_2.0.qml
index 302e27c..1273d66 100644
--- a/qmlplugins/QtQuick.Window.qml
+++ b/qmlplugins/QtQuick.Window_2.0.qml
@@ -1,5 +1,4 @@
-import Builtins1 1.0
-import QtQuick.Controls 1.0
+import QtQuick 2.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/QtQuick.Window.qml b/qmlplugins/QtQuick.Window_2.1.qml
similarity index 99%
rename from qmlplugins/QtQuick.Window.qml
rename to qmlplugins/QtQuick.Window_2.1.qml
index 302e27c..998f6fe 100644
--- a/qmlplugins/QtQuick.Window.qml
+++ b/qmlplugins/QtQuick.Window_2.1.qml
@@ -1,5 +1,4 @@
-import Builtins1 1.0
-import QtQuick.Controls 1.0
+import QtQuick.Window 2.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/QtQuick.XmlListModel.qml b/qmlplugins/QtQuick.XmlListModel_2.0.qml
similarity index 98%
rename from qmlplugins/QtQuick.XmlListModel.qml
rename to qmlplugins/QtQuick.XmlListModel_2.0.qml
index 7e24088..ced2bbf 100644
--- a/qmlplugins/QtQuick.XmlListModel.qml
+++ b/qmlplugins/QtQuick.XmlListModel_2.0.qml
@@ -1,4 +1,4 @@
-import Builtins1 1.0
+import QtQuick 2.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/Builtins2.qml b/qmlplugins/QtQuick_1.0.qml
similarity index 99%
rename from qmlplugins/Builtins2.qml
rename to qmlplugins/QtQuick_1.0.qml
index 6672239..50c08b9 100644
--- a/qmlplugins/Builtins2.qml
+++ b/qmlplugins/QtQuick_1.0.qml
@@ -1,5 +1,3 @@
-import Builtins1 1.0
-
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
 //
diff --git a/qmlplugins/QtQuick.qml b/qmlplugins/QtQuick_1.1.qml
similarity index 99%
rename from qmlplugins/QtQuick.qml
rename to qmlplugins/QtQuick_1.1.qml
index e00676d..f22ac8e 100644
--- a/qmlplugins/QtQuick.qml
+++ b/qmlplugins/QtQuick_1.1.qml
@@ -1,5 +1,4 @@
-import Builtins1 1.0
-import Builtins2 1.0
+import QtQuick 1.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/Builtins1.qml b/qmlplugins/QtQuick_2.0.qml
similarity index 99%
copy from qmlplugins/Builtins1.qml
copy to qmlplugins/QtQuick_2.0.qml
index 6677c03..6d20f7a 100644
--- a/qmlplugins/Builtins1.qml
+++ b/qmlplugins/QtQuick_2.0.qml
@@ -1,6 +1,3 @@
-// Needed only for the windowChanged signal. It is a huge dependency for just one signal
-// import QtQuick.Controls 1.0
-
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
 //
diff --git a/qmlplugins/Builtins1.qml b/qmlplugins/QtQuick_2.1.qml
similarity index 99%
copy from qmlplugins/Builtins1.qml
copy to qmlplugins/QtQuick_2.1.qml
index 6677c03..31ee71f 100644
--- a/qmlplugins/Builtins1.qml
+++ b/qmlplugins/QtQuick_2.1.qml
@@ -1,5 +1,4 @@
-// Needed only for the windowChanged signal. It is a huge dependency for just one signal
-// import QtQuick.Controls 1.0
+import QtQuick 2.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/Builtins1.qml b/qmlplugins/QtQuick_2.2.qml
similarity index 99%
rename from qmlplugins/Builtins1.qml
rename to qmlplugins/QtQuick_2.2.qml
index 6677c03..f4c1c71 100644
--- a/qmlplugins/Builtins1.qml
+++ b/qmlplugins/QtQuick_2.2.qml
@@ -1,5 +1,4 @@
-// Needed only for the windowChanged signal. It is a huge dependency for just one signal
-// import QtQuick.Controls 1.0
+import QtQuick 2.1
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/QtSensors.qml b/qmlplugins/QtSensors_5.0.qml
similarity index 99%
copy from qmlplugins/QtSensors.qml
copy to qmlplugins/QtSensors_5.0.qml
index ada6d52..373855b 100644
--- a/qmlplugins/QtSensors.qml
+++ b/qmlplugins/QtSensors_5.0.qml
@@ -1,4 +1,4 @@
-import Builtins1 1.0
+import QtQuick 2.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/QtSensors.qml b/qmlplugins/QtSensors_5.1.qml
similarity index 99%
rename from qmlplugins/QtSensors.qml
rename to qmlplugins/QtSensors_5.1.qml
index ada6d52..21dfe03 100644
--- a/qmlplugins/QtSensors.qml
+++ b/qmlplugins/QtSensors_5.1.qml
@@ -1,4 +1,4 @@
-import Builtins1 1.0
+import QtSensors 5.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/QtTest.qml b/qmlplugins/QtTest_1.0.qml
similarity index 99%
rename from qmlplugins/QtTest.qml
rename to qmlplugins/QtTest_1.0.qml
index 3a0e449..234266e 100644
--- a/qmlplugins/QtTest.qml
+++ b/qmlplugins/QtTest_1.0.qml
@@ -1,4 +1,4 @@
-import Builtins1 1.0
+import QtQuick 2.0
 
 // This file describes the plugin-supplied types contained in the library.
 // It is used for QML tooling purposes only.
diff --git a/qmlplugins/makedeps.sh b/qmlplugins/makedeps.sh
deleted file mode 100755
index 7723c94..0000000
--- a/qmlplugins/makedeps.sh
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/bash
-#
-#  Copyright (C) 2014 by Denis Steckelmacher <steckdenis@yahoo.fr>
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software
-#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
-#
-
-builtinsIndex="1"
-
-# Index the identifiers declared and used in each module
-> /tmp/qml_index
-
-echo "Building index..."
-
-ls *.qml | while read qmlfile
-do
-    package="$(basename "$qmlfile" .qml)"
-
-    # Identifiers declared in this package
-    cat "$qmlfile" | grep -E '^ +name: "[A-Z]' | cut -d '"' -f 2 | while read identifier
-    do
-        echo "$package $identifier " >> /tmp/qml_index
-    done
-done
-
-# Identify the packages that have to be imported in each file
-ls *.qml | while read qmlfile
-do
-    package="$(basename "$qmlfile" .qml)"
-
-    echo "Uses for $package..."
-    > "/tmp/$package.imports"
-
-    # Identifiers used in this package
-    cat "$qmlfile" | grep -Eo '(type|prototype): "[A-Za-z:]+"' | cut -d '"' -f 2 | cut -d ':' -f 1 | sort | uniq | while read identifier
-    do
-        imported="$(cat /tmp/qml_index | grep " $identifier " | head -n1 | cut -d ' ' -f 1)"
-
-        if [ "x$imported" != "x" ]
-        then
-            echo "import $imported 1.0" >> "/tmp/$package.imports"
-        fi
-    done
-
-    # Add the import statements to the beginning of the QML file
-    cat "/tmp/$package.imports" | grep -v " $package " | sort | uniq > "/tmp/$package.header"
-    cat "$qmlfile" | grep -v "^import" > "/tmp/$package.body"
-    cat "/tmp/$package.header" "/tmp/$package.body" > "$qmlfile"
-done
-
diff --git a/tests/files/test.qml b/tests/files/test.qml
index 86e55d1..3c9e349 100644
--- a/tests/files/test.qml
+++ b/tests/files/test.qml
@@ -1,4 +1,4 @@
-import QtQuick 1.1
+import QtQuick 2.0
 
 /**
  * "type" : { "toString" : "test" },
