From 8764f0b77cf9882329f78d77350182affe17ff2b Mon Sep 17 00:00:00 2001 From: Ivan Ilin Date: Thu, 9 Feb 2012 17:19:34 +0200 Subject: [PATCH] move event to dnd added --- src/api/UBWidgetUniboardAPI.cpp | 6 +++++- src/gui/UBMagnifer.cpp | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/api/UBWidgetUniboardAPI.cpp b/src/api/UBWidgetUniboardAPI.cpp index 9f2b362e..9d8184f3 100644 --- a/src/api/UBWidgetUniboardAPI.cpp +++ b/src/api/UBWidgetUniboardAPI.cpp @@ -572,7 +572,7 @@ void UBWidgetUniboardAPI::ProcessDropEvent(QDropEvent *event) QDropEvent readyEvent(dropPoint, dropActions, &dropMimeData, dropMouseButtons, dropModifiers); //sending event to destination either it had been downloaded or not QApplication::sendEvent(mGraphicsWidget->widgetWebView(),&readyEvent); -// readyEvent.acceptProposedAction(); + readyEvent.acceptProposedAction(); } void UBWidgetUniboardAPI::onDownloadFinished(bool pSuccess, sDownloadFileDesc desc, QByteArray pData) @@ -624,6 +624,10 @@ void UBWidgetUniboardAPI::onDownloadFinished(bool pSuccess, sDownloadFileDesc de destFile.close(); + //To make js interpreter accept drop event we need to generate move event first. + QDragMoveEvent readmove(dropPoint, desc.dropActions, &dropMimeData, desc.dropMouseButtons, desc.dropModifiers); + QApplication::sendEvent(mGraphicsWidget->widgetWebView(),&readmove); + QDropEvent readyEvent(dropPoint, desc.dropActions, &dropMimeData, desc.dropMouseButtons, desc.dropModifiers); //sending event to destination either it had been downloaded or not QApplication::sendEvent(mGraphicsWidget->widgetWebView(),&readyEvent); diff --git a/src/gui/UBMagnifer.cpp b/src/gui/UBMagnifer.cpp index b98edf18..08285c91 100644 --- a/src/gui/UBMagnifer.cpp +++ b/src/gui/UBMagnifer.cpp @@ -60,7 +60,7 @@ UBMagnifier::UBMagnifier(QWidget *parent, bool isInteractive) // standalone window // !!!! Should be included into Windows after QT recompilation #ifndef Q_WS_WIN - setAttribute(Qt::WA_TranslucentBackground); +// setAttribute(Qt::WA_TranslucentBackground); setAttribute(Qt::WA_MacAlwaysShowToolWindow); #endif #ifdef Q_WS_MAC @@ -97,7 +97,6 @@ UBMagnifier::~UBMagnifier() delete sDecreasePixmap; sDecreasePixmap = NULL; } - } void UBMagnifier::setSize(qreal percentFromScene)