diff options
author | Christian Kamm <christian.d.kamm@nokia.com> | 2011-09-13 14:29:47 +0200 |
---|---|---|
committer | Christian Kamm <christian.d.kamm@nokia.com> | 2011-09-14 13:00:29 +0200 |
commit | 5b1a24ab95d8cd6ceb8beb46bc1acdfeac357082 (patch) | |
tree | 3c27019172992ca296d810d74d6b3e5ea98c92b6 /src/libs/qmljs/qmljsvalueowner.cpp | |
parent | fa281be8bffe5ef3c19814984eb546c8cff6d4cf (diff) | |
download | qt-creator-5b1a24ab95d8cd6ceb8beb46bc1acdfeac357082.tar.gz |
QmlJS: Improve completion of signals.
* Change from Reference to FunctionValue: There was no reason for them
being References as the argument types never need lookup.
* Enumerate in global completion: When you define 'signal foo(int a)'
you now get completion for 'foo' and will get the function argument
hint popup.
Change-Id: Ic348db477a34ba468dfdb690499a9cd8fd605cd2
Reviewed-on: http://codereview.qt-project.org/4774
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
Diffstat (limited to 'src/libs/qmljs/qmljsvalueowner.cpp')
-rw-r--r-- | src/libs/qmljs/qmljsvalueowner.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/libs/qmljs/qmljsvalueowner.cpp b/src/libs/qmljs/qmljsvalueowner.cpp index 8a5b5ced37..2f0764c0d7 100644 --- a/src/libs/qmljs/qmljsvalueowner.cpp +++ b/src/libs/qmljs/qmljsvalueowner.cpp @@ -928,21 +928,24 @@ const ObjectValue *ValueOwner::qmlVector3DObject() return _qmlVector3DObject; } -const Value *ValueOwner::defaultValueForBuiltinType(const QString &typeName) const +const Value *ValueOwner::defaultValueForBuiltinType(const QString &name) const { - if (typeName == QLatin1String("string")) - return stringValue(); - else if (typeName == QLatin1String("url")) - return urlValue(); - else if (typeName == QLatin1String("bool")) + if (name == QLatin1String("int")) { + return intValue(); + } else if (name == QLatin1String("bool")) { return booleanValue(); - else if (typeName == QLatin1String("int")) - return intValue(); - else if (typeName == QLatin1String("real")) + } else if (name == QLatin1String("double") + || name == QLatin1String("real")) { return realValue(); - else if (typeName == QLatin1String("color")) + } else if (name == QLatin1String("string")) { + return stringValue(); + } else if (name == QLatin1String("url")) { + return urlValue(); + } else if (name == QLatin1String("color")) { return colorValue(); - // ### more types... - + } else if (name == QLatin1String("date")) { + return datePrototype(); + } + // ### variant return undefinedValue(); } |