How can I do mouse click event on graph using QChartView?
-
I created a QChartView on top of a grid layout to draw the graph.(
I referenced the Creator's sample code.)When I click this graph, I want to display the mouse click position on the text label in the main window.
I inherited QChartView and created a ChartView class and defined the mousePressEvent() function, but the mouse click did not work.
Not sure what i am missing
It would be appreciated if you uploaded the example code that can be operated.I'm using C++/Window/Visual Studio 2019/Qt 5.15.1
Thank you
-
I created a QChartView on top of a grid layout to draw the graph.(
I referenced the Creator's sample code.)When I click this graph, I want to display the mouse click position on the text label in the main window.
I inherited QChartView and created a ChartView class and defined the mousePressEvent() function, but the mouse click did not work.
Not sure what i am missing
It would be appreciated if you uploaded the example code that can be operated.I'm using C++/Window/Visual Studio 2019/Qt 5.15.1
Thank you
-
Thank you
But, The mouse press event itself doesn't seem to work.
So I want an example code with a mouse press event action.