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. Drawing a virtual mouse cursor
QtWS25 Last Chance

Drawing a virtual mouse cursor

Scheduled Pinned Locked Moved Unsolved General and Desktop
widgetsmousemouse controlcursor
2 Posts 2 Posters 1.6k 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.
  • K Offline
    K Offline
    kshegunov
    Moderators
    wrote on 19 Dec 2015, 11:41 last edited by
    #1

    Hello, my question is related to a previous one I asked recently. Although I've made progress with restricting the mouse cursor to a certain area, there are artifacts that bug me and I wish to fix them.

    • When the cursor is leaving the window I get a resize icon shown that I wish to avoid. Unfortunately, the resize cursor is not managed by Qt but by the window manager instead.
    • There is significant flicker at the edges, especially if the mouse movement is fast. I attribute this to the way events are handled - after the cursor changes position, Qt is notified, it creates and dispatches the mouse event, in which I'm setting the cursor position anew, to the correct coordinates - if I'm wrong please correct me. This means that I'm actually intercepting the event after the OS has handled the cursor movement and this leads to flicker.

    @Chris-Kawa has suggested that I implement a virtual cursor and intercept and dispatch the mouse events by myself. This if fine with me. The question is how to draw the virtual cursor. Is it supposed to be a widget that I'll be moving around, a pix/bitmap that I should draw directly on the screen? One other thing I was wondering about is, whether I could use the system cursor (image) in some way (I don't intend to change its appearance). Any suggestion on how to go about drawing the cursor is greatly appreciated.

    Kind regards.

    Read and abide by the Qt Code of Conduct

    1 Reply Last reply
    0
    • K Offline
      K Offline
      Kokokona
      Banned
      wrote on 23 Apr 2021, 18:42 last edited by
      #2
      This post is deleted!
      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