Important: Please read the 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) {
    do sth else...
    Start = std::chrono::high_resolution_clock::now();

  • Lifetime Qt Champion


    What exactly are you trying to achieve ?

Log in to reply