Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-140687

Expose QGuiApplicationPrivate::getPixmapCursor() plus hotspot coordinates

XMLWordPrintable

      As part of our application, we add hint images to the mouse cursor. This is very similar to what QDrag does during a drag-and-drop operation, where a small picture of the dragged data is added to the system cursor. However, QDrag::dragCursor builds its cursor image by calling QGuiApplicationPrivate::instance()->getPixmapCursor(shape), and QGuiApplicationPrivate::getPixmapCursor() doesn't appear to be publicly exposed. As a result, there's no way for our code to similarly modify the cursor, since we have no way of accessing an image of the system cursor (other than writing separate platform-specific code for each platform we use). We're currently using a custom arrow image and adding the hints to that, but this makes the application look a lot less native to each platform. We were hoping that QGuiApplicationPrivate::getPixmapCursor could be publicly exposed, along with some way to access the hotspot coordinates of the system cursor.

      I'm assuming that emscripten builds still wouldn't be able to access the system cursor image due to browser security. Is that right? We could always fall back on our custom cursor in those instances, but it would still be nice for desktop builds of our application to use the system cursor.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            kevkeating Kevin Keating
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes