When using qt c++ Qchart Linechart, I want to receive data when a button event is activated and display a graph.
-
Hello.
I am a beginner using Qt c++.Now, use Linechart among Qcharts through Qt official website, YouTube, and Google.
I am trying to draw a graph on the main screen.What I want is to draw a graph in QWidget or QLayout on a specific part of the main screen when a button is pressed. The almost examples draw graphs only in the Mainwindow constructor.
Can I know how to draw a graph on a specific part of the main screen by receiving the event when the button is pressed? No matter how much I think about it, I can't find an answer...
-
@tommy_taiwan Please start here https://doc.qt.io/qt-5/signalsandslots.html and here https://doc.qt.io/qt-5/layout.html
-
@tommy_taiwan What source code? I'm not going to write all this for you. You should learn things.
What exactly is the problem?
Do you know how to connect a slot to a signal? First step is: add a QPushButton to your ui, connect its clicked() signal to a slot where you will trigger chart...