Extending QML - Methods Example¶
Methods Support.
This example builds on:
The Methods Example has an additional method in the BirthdayParty
class: invite()
. invite()
is declared with Q_INVOKABLE
so that it can be called from QML.
<Code snippet "referenceexamples/methods/birthdayparty.h:0" not found>
In example.qml
, the invite()
method is called in the onCompleted
signal handler:
<Code snippet "referenceexamples/methods/example.qml:0" not found>
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.