Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Exporting QML files as Library - CMake
Forum Updated to NodeBB v4.3 + New Features

Exporting QML files as Library - CMake

Scheduled Pinned Locked Moved Solved QML and Qt Quick
1 Posts 1 Posters 387 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.
  • GiridharG Offline
    GiridharG Offline
    Giridhar
    wrote on last edited by Giridhar
    #1

    Hello everybody. I need to "export" all theQML files of my project into a library file that could be loaded from another project using the same URI to load a file. Searching on the web, I've found that this could be do with "Modules" so I've created one.
    I linked the generated library to my new project but when I try to open a qml file I get this error:
    "file:///ExtraModule/RootWindow.qml: No such file or directory"

    "ExtraModule" is the URI of the Module with "RESOURCE_PREFIX /".
    "RootWindow.qml" is a qml file :D

    So, it's like it can't find the file also if the library is correctly linked.
    This is the definition of the module:

    qt_add_qml_module(extra_module
        URI "ExtraModule"
        VERSION 1.0
        OUTPUT_DIRECTORY ../../ExtraModule
        RESOURCE_PREFIX /
        QML_FILES
            RootWindow.qml
            .
            .
            .
            .
            andSoOn.qml)
    

    EDIT: problem was about module plugin.
    Link that helped me: CLICK

    Founder & Developer of: https://pidmx.net
    Mac - Qt6 for Rpi4 CrossCompile Environment tutorial: https://github.com/giridhar123/Qt-Rpi4-Mac-Cross-Compile

    1 Reply Last reply
    1

    • Login

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