Yes, you have to tag your QObject function with Q_INVOKABLE
, if not public slot
, to be able to call it from QML.
Both Q_INVOKABLE and the slots keyword register your function with Qt meta-system
. The difference is that with Q_INVOKABLE you can return values.
source
share