From 723f14838fd7866130c21b78e08e3f12311c171a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=B3=E5=8D=9A=E6=96=87?= Date: Mon, 20 Jun 2016 15:42:31 +0800 Subject: [PATCH] fix item visible when drag out of panel Change-Id: I7fff7fb127d59685aa3f09f0c4517ab3715c5b1c --- frame/item/appitem.cpp | 1 + frame/panel/mainpanel.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/frame/item/appitem.cpp b/frame/item/appitem.cpp index 834154bd5..afec37071 100644 --- a/frame/item/appitem.cpp +++ b/frame/item/appitem.cpp @@ -137,6 +137,7 @@ void AppItem::startDrag() qDebug() << "dnd result: " << result; m_draging = false; + setVisible(true); update(); } diff --git a/frame/panel/mainpanel.cpp b/frame/panel/mainpanel.cpp index 35e2e5b87..bd6a701e7 100644 --- a/frame/panel/mainpanel.cpp +++ b/frame/panel/mainpanel.cpp @@ -142,5 +142,9 @@ void MainPanel::itemDragStarted() { DragingItem = qobject_cast(sender()); - DragingItem->setVisible(rect().contains(QCursor::pos())); + QRect rect; + rect.setTopLeft(mapToGlobal(pos())); + rect.setSize(size()); + + DragingItem->setVisible(rect.contains(QCursor::pos())); }