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. Drag&drop with custom cursor
Forum Updated to NodeBB v4.3 + New Features

Drag&drop with custom cursor

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 3.7k 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.
  • T Offline
    T Offline
    tomasz_grobelny
    wrote on last edited by
    #1

    Is it possible to modify drag& drop process so that I can chage pixmap and hotspot on every mouse move? Specifically I only want to allow the user to drag elements up and down, but not sideways.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      There are the dragEnter, dragMove and dragLeave events. Here you can handle custom drag/drop handling, change the cursor etc. Whether it is possible to change the drag image, I don't know, try it out :-)

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DenisKormalev
        wrote on last edited by
        #3

        Changing picture is possible only before drag starting (via QDrag::setPixmap()).

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tomasz_grobelny
          wrote on last edited by
          #4

          It seems that the only way is to create another widget and move it in dragMove event. Haven't tried it yet but seems like a fine solution.

          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