[Qt-interest] QTableView drag-and-drop behavior
Bob Hood
bhood2 at comcast.net
Sat Nov 14 16:41:03 CET 2009
I'm subclassing a QTableView with subclassed QItemDelegates in order to
display values using a custom decorator (a QPixmap). I have the
skeletal drag-and-drop functionality enabled on it to be completed at a
later time, because I'd like to be able to drag the items in the
QTableView onto other widgets on the interface, and to drop values from
other widgets onto the QTableView.
However, I'm seeing some behavior that I really don't want with respect
to dragging and dropping. When I grab an item (cell) in the QTableView
and drop it somewhere else on the QTableView widget, it creates a copy
of the item at some random location in the table. I've tried putting in
some checks in the dropEvent() to prevent it from dropping back onto the
source, but I'm apparently not doing it correctly.
Admittedly, I'm rather a noob with respect to drag-and-drop. Can
anybody provide some sage advice as to how I can keep the drag source
from becoming the drag target?
Render me gone, |||
Bob ^(===)^
---------------------------------oOO--(_)--OOo---------------------------------
The brain is a wonderful organ; it starts working the moment you get up in
the morning and does not stop until you get to the office. - /Robert Frost/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091114/a7b5677f/attachment.html
More information about the Qt-interest-old
mailing list