QmlJS: Set correct scope in signal handlers.

This means the code model will now offer correct completion and
highlighting for arguments of signals in their handlers, example:

MouseArea {
  onClicked: {
    mou<complete> // now also completes 'mouse'
  }
}

Reviewed-by: Fawzi Mohamed
Change-Id: I01838ef00e391b13e6e5a832c9ec3cd983689c5b
Reviewed-on: http://codereview.qt-project.org/6147
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
Sanity-Review: Christian Kamm <christian.d.kamm@nokia.com>
This commit is contained in:
Christian Kamm
2011-10-05 14:14:35 +02:00
parent 03689eeb50
commit 010ce2d20d
7 changed files with 108 additions and 28 deletions

View File

@@ -187,6 +187,12 @@ void ScopeChain::setJsScopes(const QList<const ObjectValue *> &jsScopes)
m_jsScopes = jsScopes;
}
void ScopeChain::appendJsScope(const ObjectValue *scope)
{
m_modified = true;
m_jsScopes += scope;
}
QList<const ObjectValue *> ScopeChain::all() const
{
if (m_modified)