Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QChart in console applications. Is this possible?

QChart in console applications. Is this possible?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 532 Views
  • 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.
  • bleriot13B Offline
    bleriot13B Offline
    bleriot13
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • bleriot13B Offline
      bleriot13B Offline
      bleriot13
      wrote on last edited by
      #2

      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.

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

        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.

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

        bleriot13B 1 Reply Last reply
        4
        • SGaistS SGaist

          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.

          bleriot13B Offline
          bleriot13B Offline
          bleriot13
          wrote on last edited by
          #4

          @SGaist Thanks!

          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