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. [SOLVED] Loading pure QML plugin from shared library and Qt Creator
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Loading pure QML plugin from shared library and Qt Creator

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 2.4k 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.
  • T Offline
    T Offline
    trollixx
    wrote on last edited by
    #1

    I want some QML components (pure QML, no C++) to reside in Qt plugin library. QML files are embedded inside qrc, but then I got a trouble loading them as QML module.

    For example, I have some components in com.mycompany.coolcomponents module described in corresponding qmldir file. The path to qmldir is :/components/com/mycompany/coolcomponents/qmldir. I added this path to QML import paths:

    @
    m_declarativeContext->engine()->addImportPath(":/components");
    @

    But importing my module in QML doesn't work.

    @
    import com.mycompany.coolcomponents 1.0
    @

    I cannot figure out what I'm doing wrong, any ideas?

    Thanks in advance.

    UPDATE: The first problem is solved (removed plugin directive from qmldir), but now Qt Creator doesn't see my components' info (no autocomplete, etc), is there any way to make it parse QMLs from plugin?

    UPDATE 2: Fixed with QML_IMPORT_PATH variable.

    Oleg

    1 Reply Last reply
    0
    • D Offline
      D Offline
      DRAX
      wrote on last edited by
      #2

      This is little old post, but can you please give some code example how did you made it?

      I am having same problem, but I am unable to solve it yet...
      This is thread: "http://qt-project.org/forums/viewthread/27538/":http://qt-project.org/forums/viewthread/27538/

      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