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] Module "XXX" is not installed
QtWS25 Last Chance

[Solved] Module "XXX" is not installed

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 6.0k Views
  • 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 Offline
    M Offline
    maksim1979
    wrote on last edited by
    #1

    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
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

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

      (Z(:^

      1 Reply Last reply
      0
      • M Offline
        M Offline
        maksim1979
        wrote on last edited by
        #3

        sierdzio, thank you very much!!!

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          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
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved