diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2019-07-03 15:13:46 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2019-07-09 16:52:55 +0200 |
commit | 910f98031fdd834a22af0da21c9ff6ae145f61c5 (patch) | |
tree | 03062e2ec8ccca2a1bbdc2c6e69587de1eedbe76 /src/qml/parser/qqmljsast_p.h | |
parent | f2cb10ebc4946b10526fa22581913ccc04cea164 (diff) |
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 <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/parser/qqmljsast_p.h')
-rw-r--r-- | src/qml/parser/qqmljsast_p.h | 4 |
1 files changed, 4 insertions, 0 deletions
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<BoundName> |