[PyQt] Drag-and-drop editing in QListWidget or QListView

Nathan Weston nathan at genarts.com
Tue Jun 7 12:53:05 BST 2011



On 06/02/2011 07:42 PM, David Boddie wrote:
> The draganddrop/puzzle example provided with PyQt uses a QListWidget to
> display a collection of puzzle pieces that can be dropped inside or outside
> the list, though it's not exactly the most user friendly interface you
> could imagine.
>
> The itemviews/puzzle example is more or less the same, but uses QListView
> instead of QListWidget. It implements support for drag and drop in a
> custom model, which is based on QAbstractListModel to make it as simple as
> possible. Strangely, the piece movement is quite a bit more intuitive than
> in the other example.
>

Thanks, that got me started in the right direction. It seems that I 
basically have to reimplement the InternalMove behavior myself -- it has 
some nice visual touches that aren't duplicated in the examples.

This leaves me wondering, though -- if InternalMove doesn't give you any 
way to find out when things move, what's the point?

-- 
. . . . . . . . . . . . . . . . . . . . . . . . .
Nathan Weston                   nathan at genarts.com
GenArts, Inc.                   Tel: 617-492-2888
955 Mass. Ave                   Fax: 617-492-2852
Cambridge, MA 02139 USA         www.genarts.com


More information about the PyQt mailing list