Qml Plugin Create and use in application



  • Hallo I', trying to build up a qml plugin,
    i created a QtQuick2 Extension PLugin and once builded i got the plugin.dll.
    So I tried to generate qmltypes: I put the qmldir file in the same directory of the dll and gave the following command:

    qmlplugindump.exe -nonrelocatable -v oboComponents 1.0 C:/Users/Diego/Documents/build-NetTcpConnection-Desktop_Qt_5_12_2_MinGW_64_bit2-Release/oboComponents C:/Users/Diego/Documents/build-NetTcpConnection-Desktop_Qt_5_12_2_MinGW_64_bit2-Release/oboComponents/plugins.qmltypes

    But I got the following error:
    Incorrect number of positional arguments

    this is the qmldir file:
    module oboComponents
    plugin NetTcpConnection

    If try to import the plugin in a project of course the pulgin is no loaded.

    Who can help me?
    Thank you


  • Moderators

    @Delavega77
    the plugin dump tool is only needed for autocompletion in QtCreator. so thats not the cause for the plugin not being loaded.

    Whats the used Kit/compiler?
    Whats the name of the DLL?
    Where did you put the DLL?
    Whats the plugins import url?
    Did you specify an QML import path to the QQmlEngine?
    Are you aware that a release app can on load release plugins and a debug app can only load debug plugins?

    You might also want to set QML_IMPORT_TRACE=1 env variable and check the console output.


Log in to reply
 

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