Important: Please read the Qt Code of Conduct -

Qml: Access to a qml slot from a plugin

  • Hello everyone,
    Currently I have project (an qml application) and a plugin. The application has a view and user clicks on the view and on Pressed slot is called.

    id: scene
    MouseArea {"clicked");
    rootContext->setContextProperty("QmlEngine", &engine); // Top layer engine
    Item{"From application??")

    Now I have a plugin (it is a C++ and Qml application and uses a interface provided by the project to load) and this plugin must receive the onPressed event. Can i use the "QmlEngine" to find the component in my plugin qml or is there any other way ? The goal is to create geometry shapes from the plugin on the application scene. I have simplified the above code to keep it minimal.

Log in to reply