summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets/api
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-03-28 17:14:30 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-08 14:00:10 +0200
commit96425960f9d57387c33e3ba50785aaa81255bc98 (patch)
tree01799f1235c85ffef420c06c5598ebd4e028339e /src/webenginewidgets/api
parent84f31c11b77a62212451cb77adae63219e06de96 (diff)
Render the widgets view using the scene graph into a QOpenGLWidget
This means that widgets application now need to setup the GL context sharing as well. QWebEngineWidgets::initialize() must be called, which has the same effect as QWebEngine::initialize(). The QtWebEngineWidgets now depends on the QtWebEngine module to make this happen. Since QOpenGLWidget is only available in Qt 5.3, this patch also disables the webenginewidgets module completely when building using Qt 5.2. Change-Id: I0e99a779d1eb080f2ccf5a338ff0763ad64e6eba Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/webenginewidgets/api')
-rw-r--r--src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp49
-rw-r--r--src/webenginewidgets/api/qtwebenginewidgetsglobal.h6
-rw-r--r--src/webenginewidgets/api/qwebenginepage.cpp4
3 files changed, 57 insertions, 2 deletions
diff --git a/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp b/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp
new file mode 100644
index 000000000..f3792248e
--- /dev/null
+++ b/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qtwebenginewidgetsglobal.h"
+
+#include "qtwebengineglobal.h"
+
+void QWebEngineWidgets::initialize()
+{
+ QWebEngine::initialize();
+}
diff --git a/src/webenginewidgets/api/qtwebenginewidgetsglobal.h b/src/webenginewidgets/api/qtwebenginewidgetsglobal.h
index d875c1cbe..1836de357 100644
--- a/src/webenginewidgets/api/qtwebenginewidgetsglobal.h
+++ b/src/webenginewidgets/api/qtwebenginewidgetsglobal.h
@@ -55,6 +55,12 @@ QT_BEGIN_NAMESPACE
# define QWEBENGINEWIDGETS_EXPORT
#endif
+class QWEBENGINEWIDGETS_EXPORT QWebEngineWidgets
+{
+public:
+ static void initialize();
+};
+
QT_END_NAMESPACE
#endif // QTWEBENGINEWIDGETSGLOBAL_H
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
index a5e5f8320..a879a94ef 100644
--- a/src/webenginewidgets/api/qwebenginepage.cpp
+++ b/src/webenginewidgets/api/qwebenginepage.cpp
@@ -148,7 +148,7 @@ void CallbackDirectory::CallbackSharedDataPointer::doDeref()
QWebEnginePagePrivate::QWebEnginePagePrivate()
: QObjectPrivate(QObjectPrivateVersion)
- , adapter(new WebContentsAdapter(SoftwareRenderingMode))
+ , adapter(new WebContentsAdapter(HardwareAccelerationMode))
, history(new QWebEngineHistory(new QWebEngineHistoryPrivate(this)))
, view(0)
{
@@ -353,7 +353,7 @@ void QWebEnginePagePrivate::_q_webActionTriggered(bool checked)
void QWebEnginePagePrivate::recreateFromSerializedHistory(QDataStream &input)
{
- QExplicitlySharedDataPointer<WebContentsAdapter> newWebContents = WebContentsAdapter::createFromSerializedNavigationHistory(input, this, WebContentsAdapterClient::SoftwareRenderingMode);
+ QExplicitlySharedDataPointer<WebContentsAdapter> newWebContents = WebContentsAdapter::createFromSerializedNavigationHistory(input, this, WebContentsAdapterClient::HardwareAccelerationMode);
if (newWebContents) {
adapter = newWebContents.data();
adapter->initialize(this);