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. How to access qml files of plugins defined in qmldir?
Forum Updated to NodeBB v4.3 + New Features

How to access qml files of plugins defined in qmldir?

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 118 Views
  • 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.
  • J Offline
    J Offline
    JJCodes
    wrote on last edited by
    #1

    Hi Guys, I am currently trying to set up a plugin system for QML extensions. For that i came across the qmldir file, where it seems that you can define which scripts and qml files are packed in a QML extension. I tried to add a qml file in my qmldir which is set up like that:

    module NameList
    plugin NameListPlugin
    NameList 1.0 NameListComponent.qml
    classname NameListPlugin
    classname NameListInterface
    

    Unfortunately in the consuming app I get the exception that the module namelist is not available and escepially NameListComponent.qml is a unknown type. I try to use it in an qml file like this:

    import QtQuick 2.14
    import QtQuick.Window 2.14
    import NameList 1.0
    import QtQuick.Controls 2.0
    import QtQuick.Layouts 1.3
    
    // this is only possible because it was registered in main.cpp!
    
    Window {
        width: 640
        height: 480
        visible: true
        title: qsTr("Hello World")
        NameListComponent{
        }
    }
    

    Why could that be the case and how to use it really?

    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