From 910f98031fdd834a22af0da21c9ff6ae145f61c5 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 3 Jul 2019 15:13:46 +0200 Subject: Add support for C++ accessible typed parameters and return types in qml functions These can be declared using the new typescript-like syntax and using type names that are also used for signal parameters and property types. This merely affects their signature on the C++ side and allows the corresponding invocation. Change-Id: Icaed4ee0dc7aa71330f99d96e073a2a63d409bbe Reviewed-by: Ulf Hermann --- src/qml/parser/qqmljsast_p.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/qml/parser/qqmljsast_p.h') diff --git a/src/qml/parser/qqmljsast_p.h b/src/qml/parser/qqmljsast_p.h index da8d0bcd8d..ea854c3754 100644 --- a/src/qml/parser/qqmljsast_p.h +++ b/src/qml/parser/qqmljsast_p.h @@ -364,6 +364,9 @@ public: SourceLocation lastSourceLocation() const override { return typeArguments ? typeArguments->lastSourceLocation() : typeId->lastSourceLocation(); } + QString toString() const; + void toString(QString *out) const; + // attributes UiQualifiedId *typeId; Node *typeArguments; // TypeArgumentList @@ -838,6 +841,7 @@ struct QML_PARSER_EXPORT BoundName : id(id), typeAnnotation(typeAnnotation) {} BoundName() = default; + QString typeName() const { return typeAnnotation ? typeAnnotation->type->toString() : QString(); } }; struct BoundNames : public QVector -- cgit v1.2.3