summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcl/inc/qt5/Qt5DragAndDrop.hxx1
-rw-r--r--vcl/inc/qt5/Qt5Frame.hxx1
-rw-r--r--vcl/qt5/Qt5DragAndDrop.cxx13
-rw-r--r--vcl/qt5/Qt5Frame.cxx19
-rw-r--r--vcl/qt5/Qt5Widget.cxx3
5 files changed, 37 insertions, 0 deletions
diff --git a/vcl/inc/qt5/Qt5DragAndDrop.hxx b/vcl/inc/qt5/Qt5DragAndDrop.hxx
index 424a1ba638e4..d1116ddfee96 100644
--- a/vcl/inc/qt5/Qt5DragAndDrop.hxx
+++ b/vcl/inc/qt5/Qt5DragAndDrop.hxx
@@ -108,6 +108,7 @@ public:
css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
void fire_dragEnter(const css::datatransfer::dnd::DropTargetDragEnterEvent& dtde);
+ void fire_drop(const css::datatransfer::dnd::DropTargetDropEvent& dtde);
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/qt5/Qt5Frame.hxx b/vcl/inc/qt5/Qt5Frame.hxx
index 9ee9f50666e9..110fa9b279cf 100644
--- a/vcl/inc/qt5/Qt5Frame.hxx
+++ b/vcl/inc/qt5/Qt5Frame.hxx
@@ -135,6 +135,7 @@ public:
virtual void registerDropTarget(Qt5DropTarget* pDropTarget);
virtual void deregisterDropTarget(Qt5DropTarget const* pDropTarget);
void draggingStarted(const int x, const int y);
+ void dropping(const int x, const int y);
virtual void SetExtendedFrameStyle(SalExtStyle nExtStyle) override;
virtual void Show(bool bVisible, bool bNoActivate = false) override;
diff --git a/vcl/qt5/Qt5DragAndDrop.cxx b/vcl/qt5/Qt5DragAndDrop.cxx
index ac9a0fdb6339..569c24f2bdac 100644
--- a/vcl/qt5/Qt5DragAndDrop.cxx
+++ b/vcl/qt5/Qt5DragAndDrop.cxx
@@ -201,6 +201,19 @@ void Qt5DropTarget::fire_dragEnter(const css::datatransfer::dnd::DropTargetDragE
}
}
+void Qt5DropTarget::fire_drop(const css::datatransfer::dnd::DropTargetDropEvent& 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->drop(dtde);
+ }
+}
+
void Qt5DropTarget::acceptDrag(sal_Int8 /*dragOperation*/) { return; }
void Qt5DropTarget::rejectDrag() { return; }
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index bbf541dea312..a58e7b18d4b4 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -901,4 +901,23 @@ void Qt5Frame::draggingStarted(const int x, const int y)
}
}
+void Qt5Frame::dropping(const int x, const int y)
+{
+ assert(m_pDropTarget);
+
+ css::datatransfer::dnd::DropTargetDropEvent aEvent;
+ aEvent.Source = static_cast<css::datatransfer::dnd::XDropTarget*>(m_pDropTarget);
+ aEvent.Context = static_cast<css::datatransfer::dnd::XDropTargetDropContext*>(m_pDropTarget);
+ aEvent.LocationX = x;
+ aEvent.LocationY = y;
+ aEvent.DropAction = css::datatransfer::dnd::DNDConstants::ACTION_MOVE; //FIXME
+ aEvent.SourceActions = css::datatransfer::dnd::DNDConstants::ACTION_MOVE;
+
+ css::uno::Reference<css::datatransfer::XTransferable> xTransferable;
+ xTransferable = m_pDragSource->GetTransferable();
+ aEvent.Transferable = xTransferable;
+
+ m_pDropTarget->fire_drop(aEvent);
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx
index 33b5faf8a9a2..a47aaca8b853 100644
--- a/vcl/qt5/Qt5Widget.cxx
+++ b/vcl/qt5/Qt5Widget.cxx
@@ -193,7 +193,10 @@ void Qt5Widget::dragMoveEvent(QDragMoveEvent* event)
void Qt5Widget::dropEvent(QDropEvent* event)
{
+ QPoint point = event->pos();
SAL_WARN("vcl.qt5", "dropevent");
+
+ m_pFrame->dropping(point.x(), point.y());
QWidget::dropEvent(event);
}