[Qt-creator] Drag&Drop in Qt Creator

Jochen Becher jochen_becher at gmx.de
Mon Mar 3 18:44:18 CET 2014

Am Montag, den 03.03.2014, 16:48 +0000 schrieb Poenitz Andre:
> > 
> > Now I wonder if there is any interest to implement a generic concept of
> > drag&drop in Qt Creator? That means one should define an API where
> > plug-ins may ask for drag&drop support (no need to make items draggable
> > if there are no consumers enabled) and define a list of mime-types and
> > QMimeData contents that are dragged from the different trees and lists.
> Generally speaking, I think this would be a very welcome addition. 
> There are a lot of places that currently operate with cut&paste only
> that might benefit from drag&drop.

So I will think about a more general approach than my current
implementation and present it in a few weeks...

Currently I hard coded the drag possibility in Project Explorer. I do
not know yet how to add the selected node to a QMimeData in a good way.
For now I saved the pointer to the ProjectExplorer::Node as a quintptr
in a QByteArray. It works but I am never happy of using dump pointer
addresses in such an interface. I would prefer some unique id (QUid)
attached to each Node and a possibility to search for a Node by QUid
from the SessionManager or ProjectExplorer. Or at least the possiblity
to verify that the address is still used as a Node and not a dangling

> Andre'

Regards, Jochen

More information about the Qt-creator mailing list