Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[Solved] Extension plugin



  • 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?



  • 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().)



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


Log in to reply