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

Move mouse cursor following pattern

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 607 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.
  • D Offline
    D Offline
    Doriana
    wrote on 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-

    Pl45m4P 1 Reply Last reply
    0
    • D Doriana

      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-

      Pl45m4P Online
      Pl45m4P Online
      Pl45m4
      wrote on 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 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.

        Pl45m4P jsulmJ 2 Replies Last reply
        0
        • D Doriana

          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.

          Pl45m4P Online
          Pl45m4P Online
          Pl45m4
          wrote on 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

            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.

            jsulmJ Online
            jsulmJ Online
            jsulm
            Lifetime Qt Champion
            wrote on 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
            • jsulmJ jsulm

              @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 last edited by
              #6

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

              1 Reply Last reply
              0

              • Login

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