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. Custom Drag&Drop cursors
Forum Updated to NodeBB v4.3 + New Features

Custom Drag&Drop cursors

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 3.1k 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.
  • M Offline
    M Offline
    munknex
    wrote on last edited by
    #1

    Is it somehow possible to use custom drag and drop cursors? It seems like now they are hardcoded (and on Windows they even don't correspond to current cursor theme).

    I also need to do it in runtime, because I'd like to use different cursors for different content type. Any ideas?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      AcerExtensa
      wrote on last edited by
      #2

      You can change cursor with help of "QCursor class":http://doc.qt.nokia.com/4.7-snapshot/qcursor.html

      Change it in "dragEnterEvent":http://qt-project.org/doc/qt-4.8/qwidget.html#dragEnterEvent and set it back in "dragLeaveEvent":http://qt-project.org/doc/qt-4.8/qwidget.html#dragLeaveEvent

      God is Real unless explicitly declared as Integer.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        munknex
        wrote on last edited by
        #3

        This won't work, because after dragEnterEvent and dragLeaveEvent handlers QDragManager reset cursors. So changing cursor there will not have any effect.

        Actually the correct way is to keep QDrag object and to call setDragCursor() every time we want to change it. But it is impossible now (4.8.3). So I've provided a "patch":https://codereview.qt-project.org/35893

        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