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. QtChart not importing even after installing it from QtMaintenance tool.
Qt 6.11 is out! See what's new in the release blog

QtChart not importing even after installing it from QtMaintenance tool.

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
11 Posts 3 Posters 3.1k 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.
  • F Offline
    F Offline
    Fakhr
    wrote on last edited by
    #1

    I know this question has been asked a lot of times, I have viewed all the answers tried everything, I even un-installed QtCreator and intalled it again, making sure that I had the correct version of Qt Charts checked my version is 5.15.2 (QtCreator Community Version 4.15.2). But still I keep getting the same error. I'm using windows.
    2.PNG
    I really need to use charts for my project, if anyone could help me it would be appreciated.

    J.HilkJ 1 Reply Last reply
    0
    • F Fakhr

      I know this question has been asked a lot of times, I have viewed all the answers tried everything, I even un-installed QtCreator and intalled it again, making sure that I had the correct version of Qt Charts checked my version is 5.15.2 (QtCreator Community Version 4.15.2). But still I keep getting the same error. I'm using windows.
      2.PNG
      I really need to use charts for my project, if anyone could help me it would be appreciated.

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by J.Hilk
      #2

      @Fakhr

      couple of things to check:

      • You're actually using the kit, where you installed QtCharts module
      • You're not using Qt6(not available yet)
      • you added the module to the project file QT += charts
      • You're using the correct import version: import QtCharts 2.15
      • you did a clean rebuild (preferably deleting the shadow build folder)

      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      F 1 Reply Last reply
      0
      • J.HilkJ J.Hilk

        @Fakhr

        couple of things to check:

        • You're actually using the kit, where you installed QtCharts module
        • You're not using Qt6(not available yet)
        • you added the module to the project file QT += charts
        • You're using the correct import version: import QtCharts 2.15
        • you did a clean rebuild (preferably deleting the shadow build folder)
        F Offline
        F Offline
        Fakhr
        wrote on last edited by
        #3

        @J-Hilk Hi, by my understanding adding QT += charts is done in C++, I'm using python, I'm new to Qml so not really sure, if I need to add it in the main.py file how do I do this. And yes I did a fresh install and deleted the previous folder. I'm also using the correct import version.

        J.HilkJ 1 Reply Last reply
        0
        • F Fakhr

          @J-Hilk Hi, by my understanding adding QT += charts is done in C++, I'm using python, I'm new to Qml so not really sure, if I need to add it in the main.py file how do I do this. And yes I did a fresh install and deleted the previous folder. I'm also using the correct import version.

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by J.Hilk
          #4

          @Fakhr said in QtChart not importing even after installing it from QtMaintenance tool.:

          @J-Hilk Hi, by my understanding adding QT += charts is done in C++, I'm using python, I'm new to Qml so not really sure, if I need to add it in the main.py file how do I do this. And yes I did a fresh install and deleted the previous folder. I'm also using the correct import version.

          I have used python in combination with Qt only once or twice, so my experience is limited.

          But IIRC it should also have a project file *.pro* at least if you develop with QtCreator ?

          it needs to be added there, it's not really c++.

          Nope, I'm wrong.

          But I don't know how it's done then, sorry :(


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          F 1 Reply Last reply
          0
          • J.HilkJ J.Hilk

            @Fakhr said in QtChart not importing even after installing it from QtMaintenance tool.:

            @J-Hilk Hi, by my understanding adding QT += charts is done in C++, I'm using python, I'm new to Qml so not really sure, if I need to add it in the main.py file how do I do this. And yes I did a fresh install and deleted the previous folder. I'm also using the correct import version.

            I have used python in combination with Qt only once or twice, so my experience is limited.

            But IIRC it should also have a project file *.pro* at least if you develop with QtCreator ?

            it needs to be added there, it's not really c++.

            Nope, I'm wrong.

            But I don't know how it's done then, sorry :(

            F Offline
            F Offline
            Fakhr
            wrote on last edited by
            #5

            @J-Hilk Sorry, but the only files I have are the qml one's I created, the main.py file main.pyproject and main.pyproject.user.

            J.HilkJ 1 Reply Last reply
            0
            • F Fakhr

              @J-Hilk Sorry, but the only files I have are the qml one's I created, the main.py file main.pyproject and main.pyproject.user.

              J.HilkJ Offline
              J.HilkJ Offline
              J.Hilk
              Moderators
              wrote on last edited by
              #6

              @Fakhr
              I corrected my post, sorry about that,

              maybe
              import PySide2.QtCharts
              inside main.py ?


              Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


              Q: What's that?
              A: It's blue light.
              Q: What does it do?
              A: It turns blue.

              F 1 Reply Last reply
              0
              • J.HilkJ J.Hilk

                @Fakhr
                I corrected my post, sorry about that,

                maybe
                import PySide2.QtCharts
                inside main.py ?

                F Offline
                F Offline
                Fakhr
                wrote on last edited by
                #7

                @J-Hilk No worries. I tried to import PySide2.QtCharts before it also doesn't seem to do anything. I honestly didn't know importing charts would be so difficult.

                J.HilkJ KroMignonK 2 Replies Last reply
                0
                • F Fakhr

                  @J-Hilk No worries. I tried to import PySide2.QtCharts before it also doesn't seem to do anything. I honestly didn't know importing charts would be so difficult.

                  J.HilkJ Offline
                  J.HilkJ Offline
                  J.Hilk
                  Moderators
                  wrote on last edited by J.Hilk
                  #8

                  @Fakhr
                  I found this QML pyside chart example
                  https://code.qt.io/cgit/pyside/pyside-setup.git/tree/examples/charts/qmlpolarchart

                  maybe it will help ?


                  Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                  Q: What's that?
                  A: It's blue light.
                  Q: What does it do?
                  A: It turns blue.

                  F 1 Reply Last reply
                  0
                  • J.HilkJ J.Hilk

                    @Fakhr
                    I found this QML pyside chart example
                    https://code.qt.io/cgit/pyside/pyside-setup.git/tree/examples/charts/qmlpolarchart

                    maybe it will help ?

                    F Offline
                    F Offline
                    Fakhr
                    wrote on last edited by
                    #9

                    @J-Hilk Yeah, sorry it doesn't. The problem is that since it can't properly import charts I can't even open the Form Editor. But thanks for the example, it'll be of great help once we can figure out the import problem.

                    1 Reply Last reply
                    0
                    • F Fakhr

                      @J-Hilk No worries. I tried to import PySide2.QtCharts before it also doesn't seem to do anything. I honestly didn't know importing charts would be so difficult.

                      KroMignonK Offline
                      KroMignonK Offline
                      KroMignon
                      wrote on last edited by
                      #10

                      @Fakhr said in QtChart not importing even after installing it from QtMaintenance tool.:

                      I honestly didn't know importing charts would be so difficult.

                      You are using Qt 5.15.2 if I have right read your initial post, so you could take a look at PySide 5.15.2 examples here: https://code.qt.io/cgit/pyside/pyside-setup.git/tree/examples/charts/qmlpolarchart?h=5.15.2

                      They use import QtCharts 2.0 (for example in View1.qml), I never used PySide, so I don't know if it is important.

                      It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth. (Sherlock Holmes)

                      F 1 Reply Last reply
                      0
                      • KroMignonK KroMignon

                        @Fakhr said in QtChart not importing even after installing it from QtMaintenance tool.:

                        I honestly didn't know importing charts would be so difficult.

                        You are using Qt 5.15.2 if I have right read your initial post, so you could take a look at PySide 5.15.2 examples here: https://code.qt.io/cgit/pyside/pyside-setup.git/tree/examples/charts/qmlpolarchart?h=5.15.2

                        They use import QtCharts 2.0 (for example in View1.qml), I never used PySide, so I don't know if it is important.

                        F Offline
                        F Offline
                        Fakhr
                        wrote on last edited by
                        #11

                        @KroMignon Hi, I looked at the example and I also used import QtCharts 2.0 but it does not do anything.

                        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