Reputation: 63
I need access to functions that wasn't marked as Q_INVOKABLE nor Q_SLOTS. Qt script module has mechanism called defaultPrototype. I wonder if it possible in QML?
I saw QtDevDays presentatin QtDD12 - QtQuick under the hood - Thomas McGuire and at 18 minute Thomas shows pure QML widget application. I think you cannot achieve it without exporting/exposing some non-invokable functions to script environment.
Is there any mechanism in QML like defualtPrototype in QtScript?
Upvotes: 2
Views: 244
Reputation: 3851
QML uses Qt Script under hood, so using the default prototype mechanism is perfectly possible. Only problem is obtaining the script engine of a declarative engine as their is no obvious API for that. Have look at the code in libkdeclarative, especially KDeclarative::initialize()
, for a viable hack to do so.
Upvotes: 2