[PySide] but with QListView and drag&drop?

Frank Rueter | OHUfx frank at ohufx.com
Tue Aug 16 06:35:01 CEST 2016


Hmm, looks like the issue is only for non-default drag/drop actions, 
i.e. when I drag a custom widget into a QListView.
I have enabled drag/drop in the model etc. but to no avail so far.

Need to tinker with this some more...

On 16/08/16 1:04 PM, Frank Rueter | OHUfx wrote:
> Hi guys,
>
> I just ran into the problem that my custom QListView class wouldn't 
> accept drop events.
> After a bit of poking I found that the culprit was the 
> QtGui.QListView.IconMode which seemed to reject drop events as a side 
> effect (bug or feature I don't know).
> So I then proceeded to use setAcceptDrops(True) to explicitly allow 
> drop events, but to no avail.
>
> However, and this is what feels like a bug, if I use 
> setAcceptDrops(False) it does accept drop events.
> Am I misunderstanding the use of this or is this a bug?
>
> Some examples:
>
> this will accept drop events:
>     view = QtGui.QListView()
>
> this will NOT accept drop events (contrary to the docs 
> <https://srinikom.github.io/pyside-docs/PySide/QtGui/QListView.html#PySide.QtGui.PySide.QtGui.QListView.setViewMode>):
>
>     view = QtGui.QListView()
>     view.setViewMode(QtGui.QListView.*IconMode*)
>
> this will NOT accept drop events (bug?):
>
>     view = QtGui.QListView()
>     view.setViewMode(QtGui.QListView.IconMode)
>     view.setAcceptDrops(*True*)
>
> this will accept drop events (bug?):
>
>     view = QtGui.QListView()
>     view.setViewMode(QtGui.QListView.IconMode)
>     view.setAcceptDrops(*False*)
>
> I am using PySide 1.2.2 and QT 4.8.7
>
> Cheers,
> frank
>
>
> -- 
> ohufxLogo 50x50 <http://www.ohufx.com> 	*vfx compositing 
> <http://ohufx.com/index.php/vfx-compositing> | *workflow customisation 
> and consulting <http://ohufx.com/index.php/vfx-customising>* *
>
>
>
> _______________________________________________
> PySide mailing list
> PySide at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/pyside

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20160816/7fcc07d4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 2666 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20160816/7fcc07d4/attachment.png>


More information about the PySide mailing list