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. QTreeView drag&drop question

QTreeView drag&drop question

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.4k 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.
  • W Offline
    W Offline
    wibstr
    wrote on last edited by
    #1

    I've got a (subclass of) QTreeview displaying a list of items and I'd like to be able to drop stuff onto particular items. My view can currently handles the drag/drop events ok, but I don't know how to give visual feedback to the user about which particular item he's about to drop onto. I want to highlight/outline the item under the cursor is under when dragging. What's the right way to do that? Do I have to use a custom ItemDelegate? Can items get dragEnter/dragLeave events? Or do I have to do everything from my QTreeView's dragEnter/Move/Leave event handlers: eg, call indexAt(event->pos()), lookup the item, and manually modify/redraw it?

    It seems like there must be some built-in support for this but I can't seem to find it. Any help greatly appreciated.

    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