Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Problem with QML plugins
Forum Updated to NodeBB v4.3 + New Features

Problem with QML plugins

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 574 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SteveG
    wrote on last edited by
    #1

    I am trying to create a plugin consisting of QML types but no C++ classes. I built a simple QML file called MyPlugin.qml that starts with “pragma Singleton” and resides in <mypath>\MyPlugin. My qmldir file consists of
    @
    module MyPlugin
    singleton MyPlugin 1.0 MyPlugin.qml
    @

    When I run
    @
    <qtpath>\5.3\mingw482_32\bin\qmlplugindump -nonrelocatable MyPlugin 1.0 .
    @

    from <mypath> a plugins.qmltypes file is created with
    @
    Module {
    Component {
    prototype: "QQuickItem"
    name: "MyPlugin"
    exports: ["MyPlugin -1.-1"]
    exportMetaObjectRevisions: [-1]
    isComposite: true
    isCreatable: false
    isSingleton: true
    . . .
    @

    and all of the methods (corresponding to my functions) and their parameters have type QVariant.

    Is my qmldir correct to generate the plugins.qmltypes file? Why do exports and exportMetaObjectRevisions have such strange content? Should these be changed to “MyPlugin 1.0” and 0, respectively? Should the QVariant types be manually changed?

    Are there any examples of creating and using Qt plugins made entirely with just QML and no C++? It would be useful to see an example that creates (1) library files, (2) plugins.qmltypes, and (3) an app using the output of 1 and 2.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved