QChart in console applications. Is this possible?
-
Hi,
I need to create a few 2d line charts and save these to .png format.
Since I use Qt regularly, I thought of using QTCHARTS to perform this task. Taking a look at the examples, more specifically at the DateTimeAxis one, I saw how to draw such plots using QChart and QChartView. I even modified the example to save the chart to disk in .png format.
But this example is a GUI-based app. I need to create the charts using a simple console application. I tried to change the .pro file to do so, but the app worked no more.
I guess that, since QTCHARTS is a GUI-oriented component of Qt, using it in a console-based app makes no sense; however, and since I don't want to show the chart on screen but just save it to disk in .png format, it makes a lot of sense to me.
Is there any way to accomplish this? Is so, could you post a very simple example, especially for the .pro file, showing how to do it???
Thank you very much!
Bleriot.
-
Hi,
just an amendment to my previous post: I would like to use the QTCHARTS component in non-GUI environments.
This means that I would like to be able to compile the code to create a non-GUI library that, afterwards, could be used by a console application... or even by a GUI-based one, if necessary.
Of course, this comment makes sense only if such a thing is possible.
Thanks anyway,
Bleriot.
-
Hi,
As soon as you are using widgets, you have a GUI library. You might be able to achieve what you want using the
offscreen
plugin though. -
Hi,
As soon as you are using widgets, you have a GUI library. You might be able to achieve what you want using the
offscreen
plugin though.