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. QtCharts import problems
Qt 6.11 is out! See what's new in the release blog

QtCharts import problems

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

    I am using PYQT and using QML , when in the QML file I import QtCharts it causes the main window never to appear (note the app is running).
    Have no idea why, if I don't import the QtCharts library everything is working, so i know the rest of the code is fine.

    main.py:
    from PyQt6.QtQml import QQmlApplicationEngine
    from PyQt6.QtCore import QObject
    from PyQt6.QtWidgets import QApplication
    import sys

    class Window(QObject):
    def init(self):
    super().init()

    app = QApplication(sys.argv)

    engine = QQmlApplicationEngine()

    window = Window()

    engine.rootContext().setContextProperty("window", window)

    engine.load('barchart.qml')

    sys.exit(app.exec())

    barchart.qml:
    import QtQuick 2.5
    import QtQuick.Controls 2.5
    import QtCharts 2.5

    ApplicationWindow {
    visible:true
    width:600
    height:400
    title:"BarChart"
    }

    Python interpreter 3.9
    PyQt6 6.4.0
    Py6t6 - charts 6.4.0

    I have no idea how to proceed from here...
    Some versions mismatch?
    Any help would be appreciated.

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Rom4ik
      wrote on last edited by
      #2

      Bumping...

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        Since you are using PyQt6, you should check with their author.

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

        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