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. QQmlComponent: Component is not ready
Forum Updated to NodeBB v4.3 + New Features

QQmlComponent: Component is not ready

Scheduled Pinned Locked Moved Solved QML and Qt Quick
9 Posts 3 Posters 5.2k 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.
  • W Offline
    W Offline
    WhatIf
    wrote on last edited by
    #1

    Hi,

    I keep receiving QQmlComponent: Component is not ready when I try to start the following qml file as dialog.

    Map qml

    I basically have mainwindow which contains a button when this button is clicked I attempt to start the map as follows:

    void MainWindow::on_openMapBtn_clicked()
    {
        QQmlEngine engine;
        QMLCommunicationAgent agent;
        engine.rootContext()->setContextProperty("agent", &agent);
        QQmlComponent component(&engine, QUrl::fromLocalFile("map.qml"));
        component.create();
    }
    

    I read some posts that suggest that the .qml file not found. So I added the .qml file to the resources file inside the / folder or perfix. I then tried

        QQmlComponent component(&engine, QUrl::fromLocalFile("qrc:/map.qml"));
    

    and

        QQmlComponent component(&engine, QUrl::fromLocalFile(":/map.qml"));
    
    

    no success.

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      @WhatIf Use errors to know what might have gone wrong. On a side note QQmlEngine engine will die as soon as the function exits.

      157

      1 Reply Last reply
      2
      • P Offline
        P Offline
        peteritv
        wrote on last edited by
        #3

        Maybe I am totally out of line here, since I am just a Qt beginner myself, but isn't there something like "onCompleted" to hold off user interaction before the system is setup?

        1 Reply Last reply
        0
        • W Offline
          W Offline
          WhatIf
          wrote on last edited by
          #4

          When I used errors, I got:

          module "QtPositioning" version 5.5 is not installed
          QQmlComponent: Component is not ready

          I started the Qt Maintenance Tool > Add or remove components > expanded Qt 5.5 but I didn't seem to find the package to install QtPositioning and when I select packages they don't list what is included in the package.

          Which package should I install?

          1 Reply Last reply
          0
          • p3c0P Offline
            p3c0P Offline
            p3c0
            Moderators
            wrote on last edited by
            #5

            @peteritv I think you need to install Qt Location as it seems they both are bound together for some reasons. See this for more info.
            Best would be to use the latest version.

            157

            1 Reply Last reply
            0
            • W Offline
              W Offline
              WhatIf
              wrote on last edited by
              #6

              I changed the import statements from

              import QtPositioning 5.5
              import QtLocation 5.5
              

              to

              import QtPositioning 5.2
              import QtLocation 5.2
              

              and I got past the module "QtPositioning" version 5.5 is not installed

              I ran the Qt Maintenance Tool > Add or remove components > expanded Qt 5.5>source components>add-ons and found that qtlocation 5.5.1-0 is checked.

              Any idea why this is happening?

              1 Reply Last reply
              0
              • p3c0P Offline
                p3c0P Offline
                p3c0
                Moderators
                wrote on last edited by
                #7

                @WhatIf Looks like there is no QtPositioning 5.5 but just 5.2
                http://doc.qt.io/qt-5/qtpositioning-index.html

                157

                1 Reply Last reply
                0
                • W Offline
                  W Offline
                  WhatIf
                  wrote on last edited by WhatIf
                  #8

                  import QtQuick 2.0
                  import QtPositioning 5.5
                  import QtLocation 5.6

                  http://doc.qt.io/qt-5/qtlocation-places-map-example.html

                  If I change

                  import QtPositioning 5.5
                  import QtLocation 5.6
                  

                  to

                  import QtPositioning 5.2
                  import QtLocation 5.2
                  

                  the program compiles fine but it doesn't display the map at all and I get

                  qml: Plugin Error (osm): The service provider does not support the QPlaceManager type.

                  in the application output.

                  I have been trying to get the map app to work for months now with no success.

                  1 Reply Last reply
                  0
                  • p3c0P Offline
                    p3c0P Offline
                    p3c0
                    Moderators
                    wrote on last edited by
                    #9

                    @WhatIf QPlaceManager was introduced in Qt 5.6 and you are using Qt 5.5.
                    I would suggest you to update to Qt 5.6 (LTS) or Qt 5.7 since most of the problems that you encounter seems to be taken care of.

                    157

                    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