diff options
Diffstat (limited to 'vcl/qt5/Qt5DragAndDrop.cxx')
-rw-r--r-- | vcl/qt5/Qt5DragAndDrop.cxx | 23 |
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; } |