summaryrefslogtreecommitdiffstats
path: root/src/core/type_conversion.cpp
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@theqtcompany.com>2015-12-16 12:38:16 +0100
committerJoerg Bornemann <joerg.bornemann@theqtcompany.com>2016-01-03 09:15:41 +0000
commit423f7ab80f814c5f4e4784e70bd3c36c44497314 (patch)
tree7c58a8795956c2542fb2d6947146c2575757f725 /src/core/type_conversion.cpp
parentcaf813a167c8a31739e7ae192a4c4921607e3ead (diff)
Implement drag and drop support
Create a QDrag for drag and drop operations that are started in the web page. React on drag and drop event of QWidget and QQuickItem. Task-number: QTBUG-43008 Change-Id: If09f09de6e6d5b5f02835985a17cc6bc3262f411 Reviewed-by: Alexandru Croitor <alexandru.croitor@theqtcompany.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Diffstat (limited to 'src/core/type_conversion.cpp')
-rw-r--r--src/core/type_conversion.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/type_conversion.cpp b/src/core/type_conversion.cpp
index d4b988552..99a7da099 100644
--- a/src/core/type_conversion.cpp
+++ b/src/core/type_conversion.cpp
@@ -37,6 +37,7 @@
#include "type_conversion.h"
#include <ui/events/event_constants.h>
+#include <ui/gfx/image/image_skia.h>
#include <QtCore/qcoreapplication.h>
namespace QtWebEngineCore {
@@ -116,6 +117,14 @@ QImage toQImage(const SkBitmap &bitmap)
return image;
}
+QImage toQImage(const gfx::ImageSkiaRep &imageSkiaRep)
+{
+ QImage image = toQImage(imageSkiaRep.sk_bitmap());
+ if (!image.isNull() && imageSkiaRep.scale() != 1.0f)
+ image.setDevicePixelRatio(imageSkiaRep.scale());
+ return image;
+}
+
int flagsFromModifiers(Qt::KeyboardModifiers modifiers)
{
int modifierFlags = ui::EF_NONE;
@@ -140,4 +149,5 @@ int flagsFromModifiers(Qt::KeyboardModifiers modifiers)
return modifierFlags;
}
+
} // namespace QtWebEngineCore