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. Import custom QML item from external library (cmake)

Import custom QML item from external library (cmake)

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 506 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.
  • SeeLookS Offline
    SeeLookS Offline
    SeeLook
    wrote on last edited by
    #1

    I created a library with some QML items.
    From application main.cpp file which uses that library I can load those items by:

    qmlRegisterType<MyClassCpp>("MyClass", 1, 0, "MyItem1");
    

    Then they can be used in QML files through import statement

    But how to avoid loading all those items from main.cpp, and just import them in QML.
    I read:
    http://doc.qt.io/qt-5/qtqml-tutorials-extending-qml-example.html
    and
    http://doc.qt.io/qt-5/qtqml-modules-cppplugins.html
    But I dont know how to do this with cmake.

    Please help

    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