From 3a72a1c7ed5adcdf3e473b50cc9c932e9290ee81 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 22 Feb 2012 10:58:28 +0100 Subject: Refactor the QPA dnd interface. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Give QPlatformDrag a synchronous drag() function returning the Qt::DropAction - Move the base functionality for asynchronous event handling to the platformsupport library as QBasicDrag (extendable base class handling drag icon and providing new virtuals) and QSimpleDrag (sample implementation for drag within the Qt application). - Change the Windows implementation accordingly. - Change XCB to be based on QBasicDrag. - Clean up QDragManager. Change-Id: I654f76f0e55a385ba189bd74f3ceaded6a8fe318 Reviewed-by: Morten Johan Sørvig --- src/widgets/itemviews/qstyleditemdelegate.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/widgets/itemviews/qstyleditemdelegate.cpp') diff --git a/src/widgets/itemviews/qstyleditemdelegate.cpp b/src/widgets/itemviews/qstyleditemdelegate.cpp index ca4c684e98..d54d78512a 100644 --- a/src/widgets/itemviews/qstyleditemdelegate.cpp +++ b/src/widgets/itemviews/qstyleditemdelegate.cpp @@ -44,6 +44,8 @@ #ifndef QT_NO_ITEMVIEWS #include #include +#include +#include #include #include #include @@ -689,8 +691,10 @@ bool QStyledItemDelegate::eventFilter(QObject *object, QEvent *event) #ifndef QT_NO_DRAGANDDROP // The window may lose focus during an drag operation. // i.e when dragging involves the taskbar on Windows. - if (QDragManager::self() && QDragManager::self()->object != 0) + QPlatformDrag *platformDrag = QGuiApplicationPrivate::instance()->platformIntegration()->drag(); + if (platformDrag && platformDrag->currentDrag()) { return false; + } #endif emit commitData(editor); -- cgit v1.2.3