Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    [Solved] Extension plugin

    QML and Qt Quick
    2
    3
    2573
    Loading More Posts
    • 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
      ephe last edited by

      I just tried to run the "chapter6-plugins" and the "plugins" declarative examples.

      I could build both of them, now I've got the dll, exp, lib and pdb files in com/nokia/TimeExample and the lib folders.
      I haven't changed the C++ or QML code of the examples.

      When I try to run the chapter6-plugins example, I get the error:
      @
      file:///C:/Qt/Qt-4.8/examples/declarative/tutorials/extending/chapter6-plugins/app.qml:45:5: PieChart is not a type
      PieChart {
      ^
      @
      and for the plugins example:
      @
      file:///C:/Qt/Qt-4.8/examples/declarative/cppextensions/plugins/plugins.qml:41:1: module "com.nokia.TimeExample" is not installed
      import com.nokia.TimeExample 1.0 // import types from the plugin
      ^
      @

      I have created a vcproj file, so I built everything in Visual Studio and I opened the qmlproject file in Qt Creator.

      Can someone tell me what I've done wrong?

      1 Reply Last reply Reply Quote 0
      • B
        blam last edited by

        It sounds like Qt Creator isn't finding the plugin library. If you are running qmlviewer you can pass the import path with the -I option to give it the current directory:

        qmlviewer -I . plugins.qml
        

        Otherwise from Qt Creator you could set the QML_IMPORT_PATH environment variable. (From C++ apps you can also set it using QDeclarativeEngine::setImportPathList().)

        1 Reply Last reply Reply Quote 1
        • E
          ephe last edited by

          Thank you, I thought that the current directory is included in the import path. That was exactly my problem!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post