Drag & Drop out of widget painting issues
Rafael Fernández López
ereslibre at kde.org
Thu Oct 4 01:36:31 BST 2007
Hi Peter, Ben and all,
I have been looking a bit in depth some behavior of QListView/QTreeView, and
I'm very glad I have had really good results. Let's start...
If we run Dolphin right now, we select random items on the Detailed or Column
view and we drag them, we can have something like:
http://media.ereslibre.es/2007/10/dolphindraggingiconmode2.png
Not good, huh ? In Qt we have a strange solution...
If we use the icon view we can wonder why icons are not going outside of the
view... hmmm... the reason is:
void QListView::startDrag(Qt::DropActions supportedActions)
{
Q_D(QListView);
if (d->viewMode == IconMode) // ### move to dynamic
internalDrag(supportedActions);
else
QAbstractItemView::startDrag(supportedActions);
}
We can find out that probably this decision was taken because of incredible
ugly cases like:
http://media.ereslibre.es/2007/10/dolphindraggingiconmode.png
Okay, in an a FAST attempt to fix this stuff, I came up with a NOT CLEAN
solution...
http://media.ereslibre.es/2007/10/mask.diff
That gives us stuff like:
http://media.ereslibre.es/2007/10/dolphindraggingiconmode-hoozah.png
http://media.ereslibre.es/2007/10/dolphindraggingiconmode-hoozah2.png
http://media.ereslibre.es/2007/10/dolphindraggingiconmode-hoozah3.png
Of course the solution is to paint items over a transparent background,
instead of setting a mask of an arbitrary color... items inside that want to
be opaque can contain that color and we don't want those items to have
holes...
I am writing a bug report for Qt tomorrow or so... explaining the stuff... and
a fix that could be much better...
Bye and thanks,
Rafael Fernández López.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071004/572e2eac/attachment.sig>
More information about the kde-core-devel
mailing list