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. How to properly configure QML import path in a C++ defined QML module in a cmake project?

How to properly configure QML import path in a C++ defined QML module in a cmake project?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qmlcmakeimport problem
3 Posts 2 Posters 903 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.
  • E Offline
    E Offline
    Ernesto Cruz
    wrote on 3 Jul 2021, 20:14 last edited by
    #1

    Hi all,
    Im adding cmake support to the cutehacks duperagent library (http client library), and everything seems to be working just fine, except the QtCreator Qml module import path. The qml engine is capable of importing the module because the unit test runs, but im unable make QtCreator to recognize it. This is the the fork with the cmake support https://github.com/ecruzolivera/duperagent

    Can someone please help me with this?

    Regards, Ernesto

    c88e843d-c04f-48be-85b0-f6286b44d47f-image.png

    1 Reply Last reply
    0
    • V Offline
      V Offline
      VRonin
      wrote on 3 Jul 2021, 21:03 last edited by
      #2

      Try adding

      set_target_properties(${PROJECT_NAME} PROPERTIES
          QT_QML_MODULE_VERSION 1.0
          QT_QML_MODULE_URI com.cutehacks.duperagent
      )
      qt6_qml_type_registration(${PROJECT_NAME})
      

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      1 Reply Last reply
      0
      • E Offline
        E Offline
        Ernesto Cruz
        wrote on 4 Jul 2021, 00:16 last edited by
        #3

        @VRonin said in How to properly configure QML import path in a C++ defined QML module in a cmake project?:

        set_target_properties(${PROJECT_NAME} PROPERTIES
        QT_QML_MODULE_VERSION 1.0
        QT_QML_MODULE_URI com.cutehacks.duperagent
        )
        qt6_qml_type_registration(${PROJECT_NAME})

        Hi, thanks for the answer but sadly it did not work

        1 Reply Last reply
        0

        1/3

        3 Jul 2021, 20:14

        • Login

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