summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJian Liang <jianliang79@gmail.com>2012-10-16 18:01:47 +0800
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-18 10:44:56 +0200
commit62e9682abecaf7e38f6dd9640a3aa964bdd21d0d (patch)
tree3fff2476c180a19059ee14863fa16846d8f83596 /src
parent5e164f2bdd140860f98ade69fba0b7e4a11c94eb (diff)
Fix Drag and Drop with Native Widgets
Task-number: QTBUG-27265 Don't check "dragOverWidget != widget" in QOleDropTarget::DragOver() because if the dropsite widget's parent widget is the drop target this check will prevent its parent widget receive drag over event and the dnd cursor indicator is also wrong. We replace the check with "!dragOverWidget->isWindow()" to prevent pass through a window. A similar issue in Qt5 beta has been fixed by https://codereview.qt-project.org/#change,35646 Change-Id: I9e18b71bd7f3ee244db61571811c51dc16b341d2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qdnd_win.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/kernel/qdnd_win.cpp b/src/gui/kernel/qdnd_win.cpp
index 23ed1a62d2..e0c4619a63 100644
--- a/src/gui/kernel/qdnd_win.cpp
+++ b/src/gui/kernel/qdnd_win.cpp
@@ -712,7 +712,9 @@ QOleDropTarget::DragOver(DWORD grfKeyState, POINTL pt, LPDWORD pdwEffect)
return NOERROR;
}
- while (dragOverWidget && dragOverWidget != widget && !acceptsDrop(dragOverWidget))
+ // Try to find a drop-enabled target in the hierarchy. Go beyond 'widget' in case
+ // it is a native child window which has its own drop site registered (QTBUG-27265).
+ while (dragOverWidget && !dragOverWidget->isWindow() && !acceptsDrop(dragOverWidget))
dragOverWidget = dragOverWidget->parentWidget();
if (!dragOverWidget || !acceptsDrop(dragOverWidget)) {