summaryrefslogtreecommitdiffstats
path: root/lib/web_event_factory.cpp
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@digia.com>2013-07-10 16:27:48 +0200
committerPierre Rossi <pierre.rossi@gmail.com>2013-07-31 13:39:50 +0200
commit67d042d04f2b6cbe98f4eba2a50ed0d374165cae (patch)
treeff24cf732fa98750400a29354219ffbd70c84e1c /lib/web_event_factory.cpp
parent519367a98334b658a93ed1ba096dba92858445c7 (diff)
Split out the Widgets and QtQuick integration
This is the first step to making proper Qt Modules out of QtWebEngine. The Widgets integration becomes a proper C++ Qt Module while we make the QtQuick side a QML plugin for now (could probably be promoted if the need arises). Code-wise, this means the introduction of a WebContentsAdapterClient interface that is subclassed by the private implementation of our API classes for delegation of things that are UI specific. Functionality from WebContents and the like is exposed via the WebContentsAdapter. Change-Id: I4ca3395b9fe8502a24e36002cfd5af44067bb6e8 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'lib/web_event_factory.cpp')
-rw-r--r--lib/web_event_factory.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/web_event_factory.cpp b/lib/web_event_factory.cpp
index 388e0f9b2..40b6b5e6f 100644
--- a/lib/web_event_factory.cpp
+++ b/lib/web_event_factory.cpp
@@ -43,13 +43,14 @@
#include "web_event_factory.h"
#include "third_party/WebKit/Source/core/platform/WindowsKeyboardCodes.h"
-#include <QApplication>
#include <QElapsedTimer>
#include <QEvent>
#include <QKeyEvent>
#include <QMouseEvent>
#include <QWheelEvent>
+static const int wheelScrollLines = 3; // FIXME: Still not available in QStyleHints in 5.1
+
using namespace WebKit;
static int windowsKeyCodeForKeyEvent(unsigned int keycode, bool isKeypad)
@@ -593,8 +594,6 @@ WebKit::WebMouseWheelEvent WebEventFactory::toWebWheelEvent(QWheelEvent *ev)
// Use the same single scroll step as QTextEdit (in QTextEditPrivate::init [h,v]bar->setSingleStep)
static const float cDefaultQtScrollStep = 20.f;
- const int wheelScrollLines = qApp->wheelScrollLines(); // can be hardcoded to 3 if we don't want to depend on QtWidgets
-
webEvent.deltaX = webEvent.wheelTicksX * wheelScrollLines * cDefaultQtScrollStep;
webEvent.deltaY = webEvent.wheelTicksY * wheelScrollLines * cDefaultQtScrollStep;