Problem with MapToValue in QtCharts



  • 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?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.