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. [solved] ListView how to get new/old row when I drag and drop
Forum Updated to NodeBB v4.3 + New Features

[solved] ListView how to get new/old row when I drag and drop

Scheduled Pinned Locked Moved General and Desktop
listviewdrag and drop
1 Posts 1 Posters 509 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.
  • gian71G Offline
    gian71G Offline
    gian71
    wrote on last edited by gian71
    #1

    My application has two identical ListViews of QStandardItems(text+icon). the first list is a source of Items and I can drag items(copy) from this list to the second one. In the second list I can move the items (Drag&Drop). Everything works fine. My problem is that when I change the position (row) of one item in the second list I have to reorder some internal structure which is linked to the rows position of the specific items. So, I need to re-index the Listview. I read a lot of documentation about Drag and Drop (non really clear compared to other subjects) but I am still trying to understand what is the right approach. I have tried to subclass the ListView and re-implement the DragEnterEvent and DropEvent...but not sure this is the right strategy for what I need to achieve...
    If somebody can give me some direction...it would be very much appreciated.
    Thanks G.

    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