Qt graph vs Qt chart
-
wrote on 19 Oct 2024, 12:50 last edited by
Hi,
In my search in the forum, it had been said that the qt chart will be replace by qt graph. But I wonder to know when I should use chart and when I should use graph; what is the differences between these two?
Cheers,
-
Hi,
In my search in the forum, it had been said that the qt chart will be replace by qt graph. But I wonder to know when I should use chart and when I should use graph; what is the differences between these two?
Cheers,
wrote on 19 Oct 2024, 14:39 last edited by Pl45m4@flyyhigh said in Qt graph vs Qt chart:
But I wonder to know when I should use chart and when I should use graph
As per documentation, for new projects it's recommended to start with Qt Graphs.
But there's nothing wrong with using Qt Charts.Probably you have to keep an eye on changes.
what is the differences between these two?
There should be no difference at some point.
Qt Graphs will fully replace and even improve the Qt Chart module.One major difference is that Charts are rendered using Qt's Graphics View Framework, while Graph elements for both C++ and QML, are rendered using Qt Quick Shapes (QML-based).
Currently there are some parts and features missing in Qt Graphs, as both modules are in development/maintenance phase:
-
Hi,
In addition to @Pl45m4, the goal of Qt Graphs is to bring performance where Qt Charts cannot due to its core components original design.
-
wrote on 22 Oct 2024, 07:14 last edited by
If you can (i.e. no feature is missing) use Qt Graphs as Qt Charts will be phased out eventually. At some you'd have to switch.
Also keep in mind that these modules are not available under the LGPL, but only GPL or commercial license. If you want a more permissive license you can use Qwt (https://qwt.sourceforge.io/) instead.
-
@flyyhigh said in Qt graph vs Qt chart:
But I wonder to know when I should use chart and when I should use graph
As per documentation, for new projects it's recommended to start with Qt Graphs.
But there's nothing wrong with using Qt Charts.Probably you have to keep an eye on changes.
what is the differences between these two?
There should be no difference at some point.
Qt Graphs will fully replace and even improve the Qt Chart module.One major difference is that Charts are rendered using Qt's Graphics View Framework, while Graph elements for both C++ and QML, are rendered using Qt Quick Shapes (QML-based).
Currently there are some parts and features missing in Qt Graphs, as both modules are in development/maintenance phase:
wrote on 22 Oct 2024, 07:27 last edited by JonB@Pl45m4 said in Qt graph vs Qt chart:
One major difference is that Charts are rendered using Qt's Graphics View Framework, while Graph elements for both C++ and QML, are rendered using Qt Quick Shapes (QML-based).
Just so I understand. I write Qt widgets applications, which (so far as I know) use no QML elements and so do not link with anything QML (right?).
Occasionally I include some Qt Charts. If I replace with Qt Graphs in future does that mean my widgets application will now use/require/link with QML elements/code?
-
@Pl45m4 said in Qt graph vs Qt chart:
One major difference is that Charts are rendered using Qt's Graphics View Framework, while Graph elements for both C++ and QML, are rendered using Qt Quick Shapes (QML-based).
Just so I understand. I write Qt widgets applications, which (so far as I know) use no QML elements and so do not link with anything QML (right?).
Occasionally I include some Qt Charts. If I replace with Qt Graphs in future does that mean my widgets application will now use/require/link with QML elements/code?
wrote on 22 Oct 2024, 07:48 last edited by@JonB said in Qt graph vs Qt chart:
If I replace with Qt Graphs in future does that mean my widgets application will now use/require/link with QML elements/code?
This needs some further investigation. A quick glance tells me that when you add the
graphs
module it will also add Qt Quick. However, the overview of the modules (https://doc.qt.io/qt-6/qtmodules.html) tells me that QML is a separate module from Quick. So, maybe the truth is in the middle: your widgets application uses/requires/links Quick, but maybe not QML (I just don't know). -
@JonB said in Qt graph vs Qt chart:
If I replace with Qt Graphs in future does that mean my widgets application will now use/require/link with QML elements/code?
This needs some further investigation. A quick glance tells me that when you add the
graphs
module it will also add Qt Quick. However, the overview of the modules (https://doc.qt.io/qt-6/qtmodules.html) tells me that QML is a separate module from Quick. So, maybe the truth is in the middle: your widgets application uses/requires/links Quick, but maybe not QML (I just don't know).wrote on 22 Oct 2024, 08:24 last edited by@SimonSchroeder
Thanks. To me "Qt Quick" is sort of the same as "QML", I have never (deliberately) used either. At present when I write pure widgets applications I presume I use neither "Quick" nor "QML", and don't need them installed.... -
@SimonSchroeder
Thanks. To me "Qt Quick" is sort of the same as "QML", I have never (deliberately) used either. At present when I write pure widgets applications I presume I use neither "Quick" nor "QML", and don't need them installed....wrote on 22 Oct 2024, 10:05 last edited by Pl45m4@JonB said in Qt graph vs Qt chart:
To me "Qt Quick" is sort of the same as "QML", I have never (deliberately) used either
QML <---> Qt Quick behaves the same as
C++ <---> Qt Widgets.QML is the "programming language" whereas Qt Quick is the actual framework.
As far as I know there are also 3rd party extensions and libraries other than Qt's Qt Quick written in/with QML
I think Qt Graphs will use Qt Quick Items "under the hood". So you are still dealing with a Qt Widget structure and regular C++ classes, but while being rendered on your graph, it will make use of QML/Qt Quick internally
-
@JonB said in Qt graph vs Qt chart:
To me "Qt Quick" is sort of the same as "QML", I have never (deliberately) used either
QML <---> Qt Quick behaves the same as
C++ <---> Qt Widgets.QML is the "programming language" whereas Qt Quick is the actual framework.
As far as I know there are also 3rd party extensions and libraries other than Qt's Qt Quick written in/with QML
I think Qt Graphs will use Qt Quick Items "under the hood". So you are still dealing with a Qt Widget structure and regular C++ classes, but while being rendered on your graph, it will make use of QML/Qt Quick internally
wrote on 22 Oct 2024, 10:28 last edited by@Pl45m4 said in Qt graph vs Qt chart:
it will make use of QML/Qt Quick internally
So that will need installing :( OK.
-
@Pl45m4 said in Qt graph vs Qt chart:
it will make use of QML/Qt Quick internally
So that will need installing :( OK.
wrote on 22 Oct 2024, 12:04 last edited by Pl45m4@JonB said in Qt graph vs Qt chart:
So that will need installing :(
There's no evidence in the documentation that you need to install something else other than the Qt Graphs module?!
Maybe the required Qt Quick components are included, I don't know?!It's just this?!
We will see when they are done with refactoring both modules.
-
@SimonSchroeder
Thanks. To me "Qt Quick" is sort of the same as "QML", I have never (deliberately) used either. At present when I write pure widgets applications I presume I use neither "Quick" nor "QML", and don't need them installed....wrote on 23 Oct 2024, 06:58 last edited by@JonB said in Qt graph vs Qt chart:
Thanks. To me "Qt Quick" is sort of the same as "QML", I have never (deliberately) used either. At present when I write pure widgets applications I presume I use neither "Quick" nor "QML", and don't need them installed....
Same here! (Never have used them, don't want them.)
1/12