diff --git a/src/plugins/qmljsinspector/qmljsclientproxy.cpp b/src/plugins/qmljsinspector/qmljsclientproxy.cpp
index 0c09172f62e2c8069dede782e53a3c0cd0cb8ac8..e0260ed4429871fcb969479c70a7bbb2f3761226 100644
--- a/src/plugins/qmljsinspector/qmljsclientproxy.cpp
+++ b/src/plugins/qmljsinspector/qmljsclientproxy.cpp
@@ -361,7 +361,7 @@ void ClientProxy::contextChanged()
             m_rootObject = QDeclarativeDebugObjectReference();
             emit objectTreeUpdated(m_rootObject);
         } else {
-            m_rootObject = m_contextQuery->rootContext().objects().first();
+            m_rootObject = m_contextQuery->rootContext().objects().last();
         }
 
         delete m_contextQuery;