diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-07-09 07:10:11 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-07-09 07:10:11 (GMT) |
commit | 5b56189c9a6c322fa595b716a9f17e39a35bcbc0 (patch) | |
tree | 2e8b4fc397d631207aa32a8c68c94100a54f0f61 /src/declarative/qml/qmlscriptparser.cpp | |
parent | 888f57107e698731c4a1dd2c46745c6293b2222e (diff) | |
parent | 7343bbb230161d563b0226011e4519f695fdc593 (diff) | |
download | Qt-5b56189c9a6c322fa595b716a9f17e39a35bcbc0.zip Qt-5b56189c9a6c322fa595b716a9f17e39a35bcbc0.tar.gz Qt-5b56189c9a6c322fa595b716a9f17e39a35bcbc0.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Conflicts:
src/declarative/qml/qmlengine.cpp
Diffstat (limited to 'src/declarative/qml/qmlscriptparser.cpp')
-rw-r--r-- | src/declarative/qml/qmlscriptparser.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 4358a3e..cd0a255 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -55,7 +55,7 @@ #include <QCoreApplication> #include <QtDebug> -#include <qfxperf.h> +#include <private/qfxperf_p.h> QT_BEGIN_NAMESPACE @@ -537,6 +537,12 @@ bool ProcessAST::visit(AST::UiPublicMember *node) bool typeFound = false; Object::DynamicProperty::Type type; + + if (memberType == QLatin1String("alias")) { + type = Object::DynamicProperty::Alias; + typeFound = true; + } + for(int ii = 0; !typeFound && ii < propTypeNameToTypesCount; ++ii) { if(QLatin1String(propTypeNameToTypes[ii].name) == memberType) { type = propTypeNameToTypes[ii].type; @@ -720,20 +726,19 @@ bool ProcessAST::visit(AST::UiSourceElement *node) if (AST::FunctionDeclaration *funDecl = AST::cast<AST::FunctionDeclaration *>(node->sourceElement)) { - if(funDecl->formals) { - QmlError error; - error.setDescription(QCoreApplication::translate("QmlParser","Slot declarations must be parameterless")); - error.setLine(funDecl->lparenToken.startLine); - error.setColumn(funDecl->lparenToken.startColumn); - _parser->_errors << error; - return false; + Object::DynamicSlot slot; + + AST::FormalParameterList *f = funDecl->formals; + while (f) { + slot.parameterNames << f->name->asString().toUtf8(); + f = f->finish(); } QString body = textAt(funDecl->lbraceToken, funDecl->rbraceToken); - Object::DynamicSlot slot; slot.name = funDecl->name->asString().toUtf8(); slot.body = body; obj->dynamicSlots << slot; + } else { QmlError error; error.setDescription(QCoreApplication::translate("QmlParser","QmlJS declaration outside Script element")); |