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. Qt Quick QtCharts Module

Qt Quick QtCharts Module

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
9 Posts 3 Posters 1.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.
  • M Offline
    M Offline
    Mo_22
    wrote on last edited by
    #1

    HI,
    I am new to QtQuick and I Need help regarding importing Module Qtcharts I get an error that "QML module not found (QtCharts").
    I use python as Backend not C++
    is there anyone who faces such a problem and could found a solution?
    is there any way to import that module?
    Thanks, Inadvance!!```

    code_text
    ```import QtQuick 2.14
    import QtQuick.Window 2.14
    import QtCharts 2.14
    Window {
        width: 640
        height: 480
        visible: true
        title: qsTr("Hello World")
    }
    
    eyllanescE 1 Reply Last reply
    0
    • M Mo_22

      HI,
      I am new to QtQuick and I Need help regarding importing Module Qtcharts I get an error that "QML module not found (QtCharts").
      I use python as Backend not C++
      is there anyone who faces such a problem and could found a solution?
      is there any way to import that module?
      Thanks, Inadvance!!```

      code_text
      ```import QtQuick 2.14
      import QtQuick.Window 2.14
      import QtCharts 2.14
      Window {
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
      }
      
      eyllanescE Offline
      eyllanescE Offline
      eyllanesc
      wrote on last edited by
      #2

      @Mo_22 Are you using pyqt or pyside? What version is it? Show the .py

      If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

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

        In pro file:

        QT += quick charts
        

        In qml file:

        import QtCharts 2.3
        

        Highest available version in 5.15, might be lower in 5.14

        C++ is a perfectly valid school of magic.

        M 1 Reply Last reply
        0
        • eyllanescE eyllanesc

          @Mo_22 Are you using pyqt or pyside? What version is it? Show the .py

          M Offline
          M Offline
          Mo_22
          wrote on last edited by
          #4

          @eyllanesc said in Qt Quick QtCharts Module:

          pyqt
          Hi,
          thank you for helping me.
          python code
          import os
          import sys

          from PyQt5 import QtCore, QtGui, QtWidgets
          from PyQt5.QtCore import QUrl, QObject, pyqtSignal, pyqtSlot
          from PyQt5.QtWidgets import QApplication
          from PyQt5.QtQml import QQmlApplicationEngine
          from PyQt5.QtQuick import QQuickImageProvider
          app = QApplication(sys.argv)

          engine = QQmlApplicationEngine()
          engine.quit.connect(app.quit)
          engine.load('main.qml')

          sys.exit(app.exec())

          and QMl Code
          mport QtQuick 2.14
          import QtQuick.Layouts 1.14
          import QtQuick.Controls 2.14
          import QtQuick.Controls.Material 2.14
          import QtQuick.Controls.Universal 2.14
          import QtCharts 2.14
          ApplicationWindow {
          id:main_window
          visible: true
          minimumHeight: 750
          minimumWidth: 1200
          ChartView {
          width: 400
          height: 300
          theme: ChartView.ChartThemeBrownSand
          antialiasing: true

              PieSeries {
                  id: pieSeries
                  PieSlice { label: "eaten"; value: 94.9 }
                  PieSlice { label: "not yet eaten"; value: 5.1 }
              }
          }
          

          }

          eyllanescE 1 Reply Last reply
          0
          • M Mo_22

            @eyllanesc said in Qt Quick QtCharts Module:

            pyqt
            Hi,
            thank you for helping me.
            python code
            import os
            import sys

            from PyQt5 import QtCore, QtGui, QtWidgets
            from PyQt5.QtCore import QUrl, QObject, pyqtSignal, pyqtSlot
            from PyQt5.QtWidgets import QApplication
            from PyQt5.QtQml import QQmlApplicationEngine
            from PyQt5.QtQuick import QQuickImageProvider
            app = QApplication(sys.argv)

            engine = QQmlApplicationEngine()
            engine.quit.connect(app.quit)
            engine.load('main.qml')

            sys.exit(app.exec())

            and QMl Code
            mport QtQuick 2.14
            import QtQuick.Layouts 1.14
            import QtQuick.Controls 2.14
            import QtQuick.Controls.Material 2.14
            import QtQuick.Controls.Universal 2.14
            import QtCharts 2.14
            ApplicationWindow {
            id:main_window
            visible: true
            minimumHeight: 750
            minimumWidth: 1200
            ChartView {
            width: 400
            height: 300
            theme: ChartView.ChartThemeBrownSand
            antialiasing: true

                PieSeries {
                    id: pieSeries
                    PieSlice { label: "eaten"; value: 94.9 }
                    PieSlice { label: "not yet eaten"; value: 5.1 }
                }
            }
            

            }

            eyllanescE Offline
            eyllanescE Offline
            eyllanesc
            wrote on last edited by
            #5

            @Mo_22 What version of PyQt5 do you use? Have you installed pyqtchart? python -m pip install pyqtchart

            If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

            1 Reply Last reply
            0
            • fcarneyF fcarney

              In pro file:

              QT += quick charts
              

              In qml file:

              import QtCharts 2.3
              

              Highest available version in 5.15, might be lower in 5.14

              M Offline
              M Offline
              Mo_22
              wrote on last edited by
              #6

              @fcarney

              Hi,
              I am using python as Backend, not C++ so I don't have a pro file Should I add a pro file if I use Pyqt and Qml?
              Thank you![alt text](Qtcreatorpythonchartview.PNG Qtcreatorinstalllibs.PNG image url)

              eyllanescE 1 Reply Last reply
              0
              • M Mo_22

                @fcarney

                Hi,
                I am using python as Backend, not C++ so I don't have a pro file Should I add a pro file if I use Pyqt and Qml?
                Thank you![alt text](Qtcreatorpythonchartview.PNG Qtcreatorinstalllibs.PNG image url)

                eyllanescE Offline
                eyllanescE Offline
                eyllanesc
                wrote on last edited by
                #7

                @Mo_22 It is not necessary to create a .pro. On the other hand, do not confuse Qt with Qt for Python. Qt installations do not influence PyQt

                If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

                M 1 Reply Last reply
                0
                • eyllanescE eyllanesc

                  @Mo_22 It is not necessary to create a .pro. On the other hand, do not confuse Qt with Qt for Python. Qt installations do not influence PyQt

                  M Offline
                  M Offline
                  Mo_22
                  wrote on last edited by
                  #8

                  @eyllanesc
                  hi,
                  Thanks a lot for your help I did check my pyqtchart version I found it 5.15.2.
                  when I change the import statement in the qml file to (import QtCharts 2.15) the program work.
                  yes, I thought there are no effects of the version of the PyQtChart on what I import in the QML
                  the last Question.
                  when I use import in the Qml file how is it works?
                  is it import from the Qt installations

                  qmlchartfinalimport.PNG image URL)

                  eyllanescE 1 Reply Last reply
                  0
                  • M Mo_22

                    @eyllanesc
                    hi,
                    Thanks a lot for your help I did check my pyqtchart version I found it 5.15.2.
                    when I change the import statement in the qml file to (import QtCharts 2.15) the program work.
                    yes, I thought there are no effects of the version of the PyQtChart on what I import in the QML
                    the last Question.
                    when I use import in the Qml file how is it works?
                    is it import from the Qt installations

                    qmlchartfinalimport.PNG image URL)

                    eyllanescE Offline
                    eyllanescE Offline
                    eyllanesc
                    wrote on last edited by
                    #9

                    @Mo_22 That is a QtCreator bug, forget it.

                    If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

                    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