From 97b984a06f9fd7f88ad4f0c076a59e1bd216732e Mon Sep 17 00:00:00 2001 From: Markku Heikkila Date: Wed, 14 Dec 2011 13:50:57 +0200 Subject: [PATCH 1/1] Drag and drop icon does not update correctly on Windows. Drag and drop icon does not update correctly because WA_acceptDrops attribute is not checked on DragOver event. Task-number: QTBUG-22987 --- src/gui/kernel/qdnd_win.cpp | 5 +++++ src/gui/kernel/qwidget_win.cpp | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qdnd_win.cpp b/src/gui/kernel/qdnd_win.cpp index 073937f..c79e7e3 100644 --- a/src/gui/kernel/qdnd_win.cpp +++ b/src/gui/kernel/qdnd_win.cpp @@ -706,6 +706,11 @@ QOleDropTarget::DragOver(DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect) return NOERROR; } + if(!dragOverWidget->acceptDrops()) { + *pdwEffect = DROPEFFECT_NONE; + return NOERROR; + } + QPoint tmpPoint = dragOverWidget->mapFromGlobal(QPoint(pt.x, pt.y)); // see if we should compress this event if ((tmpPoint == lastPoint || answerRect.contains(tmpPoint)) && lastKeyState == grfKeyState) { diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index 60446dd..ae82634 100644 --- a/src/gui/kernel/qwidget_win.cpp +++ b/src/gui/kernel/qwidget_win.cpp @@ -1768,8 +1768,6 @@ QOleDropTarget* QWidgetPrivate::registerOleDnd(QWidget *widget) Q_ASSERT(nativeParent); QWExtra *nativeExtra = nativeParent->d_func()->extra; Q_ASSERT(nativeExtra); - if (!nativeParent->acceptDrops()) - nativeParent->setAcceptDrops(true); if (!nativeExtra->oleDropWidgets.contains(widget)) nativeExtra->oleDropWidgets.append(widget); if (!nativeExtra->dropTarget) { -- 1.7.6.msysgit.0