3

I have a subclass of QStandardItemModel in which I have drag and drop working quite nicely. I store my data (pointers to classes) in a subclass of QStandardItem. The classes stored in my standarditem all inherit from the same class, and I wish to enable collections of each subclass through dropping onto a collection type object.

E.g

--Apples
  --braeburn
  --golden delicious
--Oranges
--Meat
  --pork
  --lamb
  --beef

So I can drag different types of apple underneath Apples, different meats under "Meat", etc. I do this by examining the type of both the target and the dropped item in my version of dropMimeData (i.e. get the stored class from my standardItem, check its type).

My problem is when I reject an item by returning false, the item is gone from the tree. Is there a way to get the original location of the dropped item, so I can put it back?

RAM
  • 2,257
  • 2
  • 19
  • 41
mike
  • 1,192
  • 9
  • 32

0 Answers0