How to render graphics in Qt applications?

Asked

Viewed 861 times

1

I’m developing a small application to read a serial port. I would like to know how to generate a graph that is updated in real time with two variables, one x (time), and another y (value_lido_serial), in C++ with Qt.

Below is an example of what I would like to build: inserir a descrição da imagem aqui

  • Take a look: http://qt-project.org/doc/qt-4.8/widgets-analogclock.html. Teaches how to render graphics, only it is in English.

  • 1

    Hello Nilton, welcome to Stackoverflow in English. Your question is a bit wide because Qtcreator is a development environment. To prevent your question from being dropped as wide as too wide, I suggest you edit it and define exactly what your problem is (don’t know how to plot a graph for a fixed data set? don’t know how to update the graph with new data? don’t know how to make this update occur in pre-programmed time intervals? etc). Also, if you already have a short example of code with a graph like this, it would help if you asked the question.

  • Friend, ever tried to see to use a Qtimer?

  • 1

    Assuming you already have the means to get the chart data, you considered using QPainter to make the drawing? Just use the line drawing function, and the text function for the captions.

  • To be very direct. I want some tutorial, book or material that brings me background to build an application of this.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.