Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Limiting the amount of mouseMoveEvents



  • Hi,
    So is there a way to limit the amount of mouseMoveEvents i receive per update/second?
    Using a timer doesnt work for me, every time the time is passed the else clause triggers multiple times. Why is that?

    void foo::mouseMoveEvent(QGraphicsSceneMouseEvent* e)
    {
    End = std::chrono::high_resolution_clock::now();
    if ((End - Start).count() < threshold) {
    return;
    }
    else{
    do sth else...
    Start = std::chrono::high_resolution_clock::now();
    }
    }


  • Lifetime Qt Champion

    Hi,

    What exactly are you trying to achieve ?


Log in to reply