Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Design Tooling
  3. Qt Design Studio
  4. QML Module not found
Forum Update on Monday, May 27th 2025

QML Module not found

Scheduled Pinned Locked Moved Solved Qt Design Studio
3 Posts 2 Posters 460 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.
  • T Offline
    T Offline
    t.vanbesien
    wrote on 2 Dec 2024, 16:28 last edited by
    #1

    Hi,

    The problem

    I made a working backing library and plugin in Qt Creator. I'm trying to have Qt Design Studio see it but I can't find how.

    The line:

    import Charts
    

    Gives me the error:

    Import paths:
    /home/tvanbesi/Desktop/Qt-sandbox/Sandbox-Debug/PieChart
    /home/tvanbesi/Desktop/Qt-sandbox/Sandbox/.
    /home/tvanbesi/Qt/Tools/QtDesignStudio/qt6_design_studio_reduced_version/qml
    
    For qmake projects, use the QML_IMPORT_PATH variable to add import paths.
    For Qbs projects, declare and set a qmlImportPaths property in your product to add import paths.
    For qmlproject projects, use the importPaths property to add import paths.
    For CMake projects, make sure QML_IMPORT_PATH variable is in CMakeCache.txt.
    For qmlRegister... calls, make sure that you define the Module URI as a string literal.
    

    What I tried

    The error message says:
    For qmlproject projects, use the importPaths property to add import paths.
    Correct me if I misunderstood something, but Qt Design Studio needs the qmldir and .qmltypes files to be able to "see" the module.
    And since Qt Creator compiles the library and plugin, I can see the qmldir and .qmltypes files in the build directory:
    1e4552d2-4fb4-4751-bb8d-ed19ac94aad1-image.png
    So I figured I could just update the .qmlproject importPath property with the path to the build directory:
    importPaths: [ ".", "/home/tvanbesi/Desktop/Qt-sandbox/Sandbox-Debug/PieChart" ]
    (I know Qt Design Studio shouldn't rely on Qt Creator generated stuff but it's just to make it work and try to understand now.)

    But it doesn't work. How am I supposed to do it exactly? How can I get a log of what fails when Qt Design Studio tries and fails to load the module plugin?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      t.vanbesien
      wrote on 3 Dec 2024, 14:27 last edited by
      #2

      So I found the problem if anybody has the same problem:

      You need to build the module as a plugin, i.e. a dynamic .so library (or .dll on Windows). Then use the import path of the folder containing the .so, qmldir and .qmltypes files, not the folder itself!

      e.g. for me it works with the Qt Creator build output folder: "/home/tvanbesi/Desktop/Qt-sandbox/Sandbox-Debug/qml"

      1 Reply Last reply
      1
      • T t.vanbesien has marked this topic as solved on 3 Dec 2024, 14:27
      • B Offline
        B Offline
        BBGH
        wrote on 16 Dec 2024, 03:28 last edited by BBGH
        #3

        I ran into a similar issue, the difference being that my project is in Python and I declared a QML element using the @QmlElement annotation, but it was not recognized by Qt Design Studio, even though the program ran fine and the functionality seemed to be working correctly.

        1 Reply Last reply
        0

        3/3

        16 Dec 2024, 03:28

        • Login

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