Qt Forum

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

    [Solved] Module "XXX" is not installed

    QML and Qt Quick
    2
    4
    5624
    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.
    • M
      maksim1979 last edited by

      hi guys,

      I've came across with a very strange problem. Namely I created a new "Qt Quick 2" project and then wanted to extend functionality with C++, for that I declared a class like this :
      @#include <QtDeclarative/QDeclarativeItem>

      class MyChart: public QDeclarativeItem
      {
      Q_OBJECT

      public:
      MyChart(QDeclarativeItem *parent = 0);
      };@

      @MyChart::MyChart(QDeclarativeItem *parent)
      : QDeclarativeItem(parent)
      {
      } @

      In main.cpp file I added this line:
      @qmlRegisterType<MyChart>("MyChart", 1, 0, "MyChart");@

      and after that I tried to import new module in my QML file, like this

      @import MyChart 1.0@

      in .pro file I've added this line: @QT += declarative@

      So, I'm able to compile the application, but when I run it, I've got an error:

      @ module "MyChart" is not installed
      import MyChart 1.0
      ^
      Unable to find a renderable master window QtQuick2ApplicationViewer(0x2afda4) when trying to render QtQuick2ApplicationViewer(0x2afda4) ( QRect(8,30 116x0) ).
      @
      I'm using Qt Creator 2.6.2 based on Qt 5.0.1 from revision 55e2124f32

      So, maybe someone had similar problem and can share the solution? I would really appreciate any advice. Thanks a lot

      1 Reply Last reply Reply Quote 0
      • sierdzio
        sierdzio Moderators last edited by

        You need to inherit from QQuickItem instead of QDeclarative* (which is QtQuick 1).

        (Z(:^

        1 Reply Last reply Reply Quote 0
        • M
          maksim1979 last edited by

          sierdzio, thank you very much!!!

          1 Reply Last reply Reply Quote 0
          • sierdzio
            sierdzio Moderators last edited by

            Pleasure. If that resolves your problem, please prepend "[Solved]" to this topic's title (you need to edit your initial post).

            (Z(:^

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