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. How can I resolve the error: module "QtCharts" is not installed?
Forum Updated to NodeBB v4.3 + New Features

How can I resolve the error: module "QtCharts" is not installed?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
7 Posts 4 Posters 163 Views 2 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.
  • D Offline
    D Offline
    daddyKiko57
    wrote last edited by
    #1

    I tried to run the following code, but I got the error: module "QtCharts" is not installed.

    import QtQuick 2.15
    import QtCharts 2.15
    
    Rectangle {
        id: root
        width: 1392 * scaleFactor
        height: 436 * scaleFactor
        color: theme.item.color7
    
        ChartView {
            title: "Line Chart"
            anchors.fill: parent
            antialiasing: true
    
            LineSeries {
                name: "Line"
                XYPoint { x: 0; y: 0 }
                XYPoint { x: 1.1; y: 2.1 }
                XYPoint { x: 1.9; y: 3.3 }
                XYPoint { x: 2.1; y: 2.1 }
                XYPoint { x: 2.9; y: 4.9 }
                XYPoint { x: 3.4; y: 3.0 }
                XYPoint { x: 4.1; y: 3.3 }
            }
        }
    }
    

    I have confirmed the following:

    1. The Qt Charts module is installed for my current Qt version, and other modules located in the same path are working fine.

    enter image description here

    enter image description here

    1. I have added QT += charts in my .pro file.

    enter image description here

    Any help would be greatly appreciated! Thank you. :)

    1 Reply Last reply
    0
    • D daddyKiko57

      @SGaist
      Hi,thank you so much for your warm reply!

      Yes, I did re-run qmake after -- I also double-checked that the .exe file has the latest modified timestamp.
      Additionally, I tried uninstalling and reinstalling the Qt Charts module.
      Unfortunately, the issue still persists.

      If you have any other ideas, I'd be truly grateful -- and honestly, your reply already made my day. :-)

      JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote last edited by
      #5

      @daddyKiko57 As a quick sanity check: Are you able to run the official Qt Charts examples?

      If the official examples work but your app doesn't, set the environment variables QML_IMPORT_TRACE=1 and QT_DEBUG_PLUGINS=1 before running your app from Qt Creator. What do you see in the Application Output pane?

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      D 2 Replies Last reply
      3
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote last edited by
        #2

        Hi and welcome to devnet,

        Did you re-run qmake after adding the charts module ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        D 1 Reply Last reply
        2
        • SGaistS SGaist

          Hi and welcome to devnet,

          Did you re-run qmake after adding the charts module ?

          D Offline
          D Offline
          daddyKiko57
          wrote last edited by daddyKiko57
          #3

          @SGaist
          Hi,thank you so much for your warm reply!

          Yes, I did re-run qmake after -- I also double-checked that the .exe file has the latest modified timestamp.
          Additionally, I tried uninstalling and reinstalling the Qt Charts module.
          Unfortunately, the issue still persists.

          If you have any other ideas, I'd be truly grateful -- and honestly, your reply already made my day. :-)

          JKSHJ 1 Reply Last reply
          0
          • B Offline
            B Offline
            Bandler
            wrote last edited by
            #4

            Sometimes it might help to delete the whole build directory. I had times this was resolving issues with QML builds.

            1 Reply Last reply
            1
            • D daddyKiko57

              @SGaist
              Hi,thank you so much for your warm reply!

              Yes, I did re-run qmake after -- I also double-checked that the .exe file has the latest modified timestamp.
              Additionally, I tried uninstalling and reinstalling the Qt Charts module.
              Unfortunately, the issue still persists.

              If you have any other ideas, I'd be truly grateful -- and honestly, your reply already made my day. :-)

              JKSHJ Offline
              JKSHJ Offline
              JKSH
              Moderators
              wrote last edited by
              #5

              @daddyKiko57 As a quick sanity check: Are you able to run the official Qt Charts examples?

              If the official examples work but your app doesn't, set the environment variables QML_IMPORT_TRACE=1 and QT_DEBUG_PLUGINS=1 before running your app from Qt Creator. What do you see in the Application Output pane?

              Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

              D 2 Replies Last reply
              3
              • JKSHJ JKSH

                @daddyKiko57 As a quick sanity check: Are you able to run the official Qt Charts examples?

                If the official examples work but your app doesn't, set the environment variables QML_IMPORT_TRACE=1 and QT_DEBUG_PLUGINS=1 before running your app from Qt Creator. What do you see in the Application Output pane?

                D Offline
                D Offline
                daddyKiko57
                wrote last edited by
                #6

                @JKSH
                Thank a lot for your concise reply—it really solved my problem! :)

                Although I didn’t set the QML_IMPORT_PATH, I had bundled all dependencies into the .../target/debug folder for debugging convenience. Qt then loaded QML modules from there by default, but since QtCharts was missing, a runtime error occurred.

                After deleting everything except third-party libraries in the folder and rebuilding, Qt now loads modules from the installation directory, and everything works fine.

                Your explanation gave me a much clearer picture of how Qt handles QML module loading, especially the fallback behavior—I am truly grateful!

                1 Reply Last reply
                0
                • D daddyKiko57 has marked this topic as solved
                • JKSHJ JKSH

                  @daddyKiko57 As a quick sanity check: Are you able to run the official Qt Charts examples?

                  If the official examples work but your app doesn't, set the environment variables QML_IMPORT_TRACE=1 and QT_DEBUG_PLUGINS=1 before running your app from Qt Creator. What do you see in the Application Output pane?

                  D Offline
                  D Offline
                  daddyKiko57
                  wrote last edited by
                  #7
                  This post is deleted!
                  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