QtCharts import problems
-
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 sysclass 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.5ApplicationWindow {
visible:true
width:600
height:400
title:"BarChart"
}Python interpreter 3.9
PyQt6 6.4.0
Py6t6 - charts 6.4.0I have no idea how to proceed from here...
Some versions mismatch?
Any help would be appreciated. -
Hi,
Since you are using PyQt6, you should check with their author.