Solved How to get QChart XY position?
-
I want to trigger an event when the mouse is in the area of the chart.
void MainWindow::wheelEvent(QWheelEvent *event) {
if(chart->rect().contains(event->pos())) {
qDebug()<<"in chart!";
}
}
However, it is different from the actual location on the screen.
How can I get the coordinate value of the chart area on the screen? -
@LISP said in How to get QChart XY position?:
event->pos()
Different coodinate system.
->
mapToGlobal
-
@LISP said in How to get QChart XY position?:
event->pos()
Different coodinate system.
->
mapToGlobal