Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[Solved]Create a plugin from code that also uses QML.



  • Hi everyone,

    I have some code that also relies a few qml objects that I load into my other c++ classes. I want to create a plugin from this code, something I have done in the past, but this time I am not sure how (or even if possible) to deal with the qml files that my code needs.

    What will happen to them, do I have to include them somewhere?

    The reason I am asking is because I did try to create my plugin as a test. I was expecting to see a qml button show up, instead all I got was a white background.



  • Hi,

    How are you referencing your QML items in your C++ code? Is it a pure C++ plugin or a QtQuickItem plugin? In general you can add the QML files to a resource file with a matching qmldir file to get them registered correctly when loading up your plugin.

    Cheers,
    Alex from V-Play



  • Indeed, it was only recently that I learned you are able to do that.
    Thanks for your help.


Log in to reply