QtChart not importing even after installing it from QtMaintenance tool.
-
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.
I really need to use charts for my project, if anyone could help me it would be appreciated. -
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.
I really need to use charts for my project, if anyone could help me it would be appreciated.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)
-
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)
@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-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.@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 :(
-
@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 :(
-
@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-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.
@Fakhr
I found this QML pyside chart example
https://code.qt.io/cgit/pyside/pyside-setup.git/tree/examples/charts/qmlpolarchartmaybe it will help ?
-
@Fakhr
I found this QML pyside chart example
https://code.qt.io/cgit/pyside/pyside-setup.git/tree/examples/charts/qmlpolarchartmaybe it will help ?
-
@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.
@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. -
@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.@KroMignon Hi, I looked at the example and I also used
import QtCharts 2.0
but it does not do anything.