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. Move mouse cursor following pattern
Forum Updated to NodeBB v4.3 + New Features

Move mouse cursor following pattern

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 678 Views 1 Watching
  • 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.
  • D Offline
    D Offline
    Doriana
    wrote on 2 Oct 2019, 07:50 last edited by
    #1

    Hi,
    I would like to know if there is any way to move the mouse cursor following a pattern (a line, circle, triangle, parabolic, ...) with QCursor.
    Alternatively, if not possible is it possible to use QCursor::setPos with some kind of timer? Going from point A to B in n milisec.

    Thanks,
    D-

    P 1 Reply Last reply 2 Oct 2019, 08:00
    0
    • D Doriana
      2 Oct 2019, 07:50

      Hi,
      I would like to know if there is any way to move the mouse cursor following a pattern (a line, circle, triangle, parabolic, ...) with QCursor.
      Alternatively, if not possible is it possible to use QCursor::setPos with some kind of timer? Going from point A to B in n milisec.

      Thanks,
      D-

      P Online
      P Online
      Pl45m4
      wrote on 2 Oct 2019, 08:00 last edited by
      #2

      @Doriana

      I would say, the only way to achieve this is to set the Cursor position with setPos. You have to define the path / turning points etc by yourself and move in another direction afterwards.


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      0
      • D Offline
        D Offline
        Doriana
        wrote on 2 Oct 2019, 08:10 last edited by
        #3

        Thank you, my only issue with that is that the move is instantaneous, I'd like to have the control of the speed of the move.

        P J 2 Replies Last reply 2 Oct 2019, 08:22
        0
        • D Doriana
          2 Oct 2019, 08:10

          Thank you, my only issue with that is that the move is instantaneous, I'd like to have the control of the speed of the move.

          P Online
          P Online
          Pl45m4
          wrote on 2 Oct 2019, 08:22 last edited by
          #4

          @Doriana

          You can control the speed by adding different values to your move command (like a vector) or by increasing the "fire-rate" of your timer.


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

          1 Reply Last reply
          0
          • D Doriana
            2 Oct 2019, 08:10

            Thank you, my only issue with that is that the move is instantaneous, I'd like to have the control of the speed of the move.

            J Online
            J Online
            jsulm
            Lifetime Qt Champion
            wrote on 2 Oct 2019, 08:22 last edited by
            #5

            @Doriana Then don't move the cursor to its end-position, move it in several step from current to end-position. You can use https://doc.qt.io/qt-5/animation.html for that.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            D 1 Reply Last reply 2 Oct 2019, 15:26
            2
            • J jsulm
              2 Oct 2019, 08:22

              @Doriana Then don't move the cursor to its end-position, move it in several step from current to end-position. You can use https://doc.qt.io/qt-5/animation.html for that.

              D Offline
              D Offline
              Doriana
              wrote on 2 Oct 2019, 15:26 last edited by
              #6

              @jsulm Thanks, I didn't think about making an animation, I'll try this out.

              1 Reply Last reply
              0

              1/6

              2 Oct 2019, 07:50

              • Login

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