How to make my application scriptable



  • I've got a C++-QML-application and would like to allow my users to create their own plugins for it.
    All I'd need to expose is a string that changes time after time.

    I'd want the users to be able to create a single Tab inside a TabView of my application.

    I've read QJSEngine is the way to go but I've no clue where to start.



  • Hmm, why so complicated? You create a plugin folder, all qml files inside this folder could be load from your application. For every file you create a tab and load the qml inside of it.



  • Ok that sounds ok but still how do I expose a variable or call a function in these QML-plugins upon a variable change in my application?



  • You create signals and slots, make a documentation so every plugin developer can inform about possible signals and functions to call. So the developer only need to connect to or send a signal in his plugin.



  • Please add [SOLVED] to your thread title if it's solved


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.