Problem with MapToValue in QtCharts
Unsolved
General and Desktop
-
I have class based on QtChart, in it i have event filter, and do it
bool CustomChart::eventFilter(QObject *watched, QEvent *event)
{
if( event->type() == QMouseEvent::MouseMove)
{
QMouseEvent mouseEvent = static_cast<QMouseEvent>(event);
if (line != nullptr && indexOfSelectedPoint != -1)
{
//line->replace(indexOfSelectedPoint, this->mapToValue(mouseEvent->pos()));
emit pointChange(this->mapToValue(mouseEvent->pos()), indexOfSelectedPoint);
}
}
else
{
return false;
}
}but the point replesed not under cursor, (for example, cursor on position 1000 3040 in chart, and point get position, 1750 3042) What i am doing wrong?