Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How To Move Faster?
Forum Updated to NodeBB v4.3 + New Features

How To Move Faster?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 476 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    qazaq408
    wrote on 29 Mar 2017, 13:00 last edited by VRonin
    #1

    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
        label_1->move(event->pos());
    //....
    }
    

    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?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dheerendra
      Qt Champions 2022
      wrote on 29 Mar 2017, 13:14 last edited by dheerendra
      #2

      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.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      3

      2/2

      29 Mar 2017, 13:14

      • Login

      • Login or register to search.
      2 out of 2
      • First post
        2/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved