summaryrefslogtreecommitdiff
path: root/vcl/qt5/Qt5DragAndDrop.cxx
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2018-10-15 14:44:29 +0200
committerKatarina Behrens <Katarina.Behrens@cib.de>2018-10-19 10:05:00 +0200
commit5ebef042bd44e9babd58f53b4458616aa3215beb (patch)
tree2ba2ad7304390d6bcce33954e79d88cb406c0057 /vcl/qt5/Qt5DragAndDrop.cxx
parent2c1b7e8d6a7fa22cb91919238418816671c3a497 (diff)
Kick-start beginning of drag event
Change-Id: Iaad25a7acdc7d64013bc3dd0d9410e7d2d5c6762 Reviewed-on: https://gerrit.libreoffice.org/61791 Tested-by: Jenkins Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'vcl/qt5/Qt5DragAndDrop.cxx')
-rw-r--r--vcl/qt5/Qt5DragAndDrop.cxx23
1 files changed, 21 insertions, 2 deletions
diff --git a/vcl/qt5/Qt5DragAndDrop.cxx b/vcl/qt5/Qt5DragAndDrop.cxx
index 6e83f6ff40fa..ac9a0fdb6339 100644
--- a/vcl/qt5/Qt5DragAndDrop.cxx
+++ b/vcl/qt5/Qt5DragAndDrop.cxx
@@ -16,6 +16,7 @@
#include <Qt5DragAndDrop.hxx>
#include <Qt5Frame.hxx>
+#include <Qt5Widget.hxx>
using namespace com::sun::star;
using namespace com::sun::star::uno;
@@ -63,7 +64,12 @@ void Qt5DragSource::startDrag(
m_xListener = rListener;
m_xTrans = rTrans;
- if (!m_pFrame)
+ if (m_pFrame)
+ {
+ Qt5Widget* qw = static_cast<Qt5Widget*>(m_pFrame->GetQWidget());
+ qw->startDrag();
+ }
+ else
dragFailed();
}
@@ -150,7 +156,7 @@ void Qt5DropTarget::initialize(const Sequence<Any>& rArguments)
}
m_pFrame = reinterpret_cast<Qt5Frame*>(nFrame);
- //m_pFrame->registerDropTarget(this);
+ m_pFrame->registerDropTarget(this);
m_bActive = true;
}
@@ -182,6 +188,19 @@ void Qt5DropTarget::setDefaultActions(sal_Int8 nDefaultActions)
m_nDefaultActions = nDefaultActions;
}
+void Qt5DropTarget::fire_dragEnter(const css::datatransfer::dnd::DropTargetDragEnterEvent& dtde)
+{
+ osl::ClearableGuard<::osl::Mutex> aGuard(m_aMutex);
+ std::vector<css::uno::Reference<css::datatransfer::dnd::XDropTargetListener>> aListeners(
+ m_aListeners);
+ aGuard.clear();
+
+ for (auto const& listener : aListeners)
+ {
+ listener->dragEnter(dtde);
+ }
+}
+
void Qt5DropTarget::acceptDrag(sal_Int8 /*dragOperation*/) { return; }
void Qt5DropTarget::rejectDrag() { return; }