From 872f7eb459cf92161cfb22c7b2237ae90cd5a0c1 Mon Sep 17 00:00:00 2001
From: Christian Kamm <christian.d.kamm@nokia.com>
Date: Tue, 19 Oct 2010 11:08:09 +0200
Subject: [PATCH] QmlJS: Fix completion for enums on the global Qt object.

Reviewed-by: Erik Verbruggen
---
 src/libs/qmljs/qmljsinterpreter.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/libs/qmljs/qmljsinterpreter.cpp b/src/libs/qmljs/qmljsinterpreter.cpp
index ea5166ef43d..0cf64de1eae 100644
--- a/src/libs/qmljs/qmljsinterpreter.cpp
+++ b/src/libs/qmljs/qmljsinterpreter.cpp
@@ -2401,6 +2401,11 @@ Engine::Engine()
     initializePrototypes();
 
     _cppQmlTypes.load(this, CppQmlTypesLoader::builtinObjects);
+
+    // the 'Qt' object is dumped even though it is not exported
+    // it contains useful information, in particular on enums - add the
+    // object as a prototype to our custom Qt object to offer these for completion
+    _qtObject->setPrototype(_cppQmlTypes.typeForImport(QLatin1String("Qt")));
 }
 
 Engine::~Engine()
-- 
GitLab