diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2019-08-15 15:19:31 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-08-16 09:16:38 +0200 |
commit | efe0bec9468d75b768d1e26d2a8b440ade5ba632 (patch) | |
tree | b0df9ef99a9e6b22b9111575d0dc4ab024e0e7c5 /src/qml/types/qqmlconnections_p.h | |
parent | 88534c95375e9fdbf6d5411f07c78979fe1da825 (diff) |
Allow Connections to handle signals using JavaScript functions
Requiring full function definitions as signal handlers has two
advantages:
1, We don't need a custom parser that magically recognizes properties
which would otherwise be an error in other components.
2, The user is forced to specify the full signature of the handler,
including any parameters. This helps when the functions will
eventually be compiled to C++
The old behavior is retained, generating a warning if any of the magic
bindings are still set in a Connections element. Only if no magic
bindings are found, the functions are connected. This is because there
might be functions named onFoo in old-style Connections elements and
silently connecting those to any matching signals would be a change in
behavior.
Change-Id: I8c78d8994fdcddd355fe822cde9a0702dc8c75de
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/types/qqmlconnections_p.h')
-rw-r--r-- | src/qml/types/qqmlconnections_p.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/types/qqmlconnections_p.h b/src/qml/types/qqmlconnections_p.h index f6ad1eb46c..1acc86239f 100644 --- a/src/qml/types/qqmlconnections_p.h +++ b/src/qml/types/qqmlconnections_p.h @@ -91,10 +91,14 @@ Q_SIGNALS: private: void connectSignals(); + void connectSignalsToMethods(); + void connectSignalsToBindings(); + void classBegin() override; void componentComplete() override; }; +// TODO: Drop this class as soon as we can class QQmlConnectionsParser : public QQmlCustomParser { public: |