How To Move Faster?

  • Now ,I make an APP that's include A parent window(QWidget) whith some QLabel ,it has a funtion that some Label that's choosed will move when mouse is moving.for this funtion,I use QMouseMoveEvent,the funtion looks like this

    void LookPix::mouseMoveEvent(QMouseMoveEvent* event)
        int X = event->pos.x() - (label_1->width())/2;
        int Y = event->pos.y() - (label_1->height())/2  //Be sure the mouse is in the centrl of label

    but there is a question,when I move mouse fast ,the speed of the Label always looks like more slowly than the speed of the mouse,if i move mouse fast enough,the mouse even move the outside of label! If it's happend,and I click the mouse(outside of the label) at once,the APP will be over....( There are some other codes that's about the judgement of mouse click);

    Now I want to know how to move QLabel faster,or do you have other way to move the QLabel by mouse?

  • Qt Champions 2017

    It can move this fast only. What you need is movement associated with speed. So speed factor comes into picture. Qt has no direct way of looking at speed movement. Google hit may provide some solution.

Log in to reply

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