summaryrefslogtreecommitdiffstats
path: root/src/core/render_widget_host_view_qt.cpp
diff options
context:
space:
mode:
authorSzabolcs David <davidsz@inf.u-szeged.hu>2015-11-09 06:25:56 -0800
committerJoerg Bornemann <joerg.bornemann@theqtcompany.com>2015-12-01 22:08:39 +0000
commit4ffa4cbdad93a31ef7d9712d3d91777510a1a17d (patch)
tree6466d31476873a332ab292706e590bb4b2b78102 /src/core/render_widget_host_view_qt.cpp
parent8eab04b55e6d01ca2ab473d325eb4337c5f40725 (diff)
Support custom mouse cursors
Task-number: QTBUG-43009 Change-Id: Ic36554c5137a55d9d4b9143c204d9d4400e23ff8 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'src/core/render_widget_host_view_qt.cpp')
-rw-r--r--src/core/render_widget_host_view_qt.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index 330173880..2e67b0e89 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -75,6 +75,7 @@
#include <QTextFormat>
#include <QKeyEvent>
#include <QMouseEvent>
+#include <QPixmap>
#include <QScreen>
#include <QStyleHints>
#include <QVariant>
@@ -535,7 +536,12 @@ void RenderWidgetHostViewQt::UpdateCursor(const content::WebCursor &webCursor)
shape = Qt::ClosedHandCursor;
break;
case blink::WebCursorInfo::TypeCustom:
- // FIXME: Extract from the CursorInfo.
+ if (cursorInfo.custom_image.colorType() == SkColorType::kN32_SkColorType) {
+ QImage cursor = toQImage(cursorInfo.custom_image, QImage::Format_ARGB32);
+ m_delegate->updateCursor(QCursor(QPixmap::fromImage(cursor)));
+ return;
+ }
+ // Use arrow cursor as fallback in case the Chromium implementation changes.
shape = Qt::ArrowCursor;
break;
default: