Fix drag and drop with native widgets
authorjian liang <jianliang79@gmail.com>
Tue, 25 Sep 2012 13:33:55 +0000 (21:33 +0800)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 27 Sep 2012 21:51:30 +0000 (23:51 +0200)
commit0a7e8350ae0a461d90619382c61e933eb0494be9
tree44f222e2ac1c733f28e9e201be9af0eb2a70c964
parentf9547c89ea9fd0e6d571db840c5cadab079df607
Fix drag and drop with native widgets

Task-number: QTBUG-27336

Don't check 'widget != m_widget' in
QWidgetWindow::handleDragEnterMoveEvent() since the current window's
parent widget may be the actual drop target. I replace it with a check
'!widget->isWindow()' to prevent we pass through a top level window.
I also change 'widget->mapFrom(m_widget, event->pos())' to
'widget->mapFromGlobal(m_widget->mapToGlobal(event->pos()))' since m_widget
may not be widget's parent.

Change-Id: Ia4f10f85ccdf1e27223ddc51afabd98b5d16f2fb
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
src/widgets/kernel/qwidgetwindow.cpp
tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp