[Qt-interest] drag and drop for QAbstractItemModel subclass

Sebastian Fischer creat at gmx.net
Fri Dec 19 15:36:38 CET 2008


Hello again,

I  have no real clue whatyou're actually asking. Can you be a bit more
specific  on  what  you've  implemented,  what  works  so far and what
doesn't,  what  you'd  like  to get working but don't know how or what
should  work  but  doesn't. That also includes the drag&drop settings
you have set in the QTreeView.

If  you  want  to  define if a node can be dragged (or not) you can do
that  by  reimplementing the flags() function from QAbstractItemModel,
if  you  can  already  drag  nodes  but need some custom/specific data
format  reimplement  mimeData()  (and dropMimeData() if you want to be
able to receive drops of that format in the model).

Bye,
Sebastian Fischer

on 19.12.2008 at 15:12 you wrote:
>Hello forum,
>
>I have a concrete class derived from QAbstractItemModel and shown in a QTreeView.
>
>The item Node can be dragged to  the scene and some nodes are not draggable based on some
>predefined condition.
>
>Any hint on that ?






More information about the Qt-interest-old mailing list