diff options
author | Pierre Rossi <pierre.rossi@digia.com> | 2014-07-30 18:12:27 +0200 |
---|---|---|
committer | Pierre Rossi <pierre.rossi@gmail.com> | 2014-08-04 16:55:53 +0200 |
commit | a19baad6297c5ff043f531e1bf664e7039d17fe1 (patch) | |
tree | d20381344e9ef229a20ceb879e1d121c30892d81 /src | |
parent | 202d2ac93c4b4d6aed49eaa5793c35a9071f4602 (diff) |
Do away without QWebEngineWidgets::initialize
If we consider the plugin scenario is unlikely and decide it's
unsupported for widgets, we can simplify our tests and examples
a bit on this front.
Change-Id: Idc96032c127b4ee74fb5c7b3d2cdfdf99c3a722e
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'src')
5 files changed, 5 insertions, 16 deletions
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp index 641d05011..347636fe5 100644 --- a/src/core/content_browser_client_qt.cpp +++ b/src/core/content_browser_client_qt.cpp @@ -263,7 +263,7 @@ void ShareGroupQtQuick::AboutToAddFirstContext() // This currently has to be setup by ::main in all applications using QQuickWebEngineView with delegated rendering. QOpenGLContext *shareContext = QOpenGLContextPrivate::globalShareContext(); if (!shareContext) { - qFatal("QWebEngine: OpenGL resource sharing is not set up in QtQuick. Please make sure to call QWebEngine::initialize() or QWebEngineWidgets::initialize() in your main() function."); + qFatal("QWebEngine: OpenGL resource sharing is not set up in QtQuick. Please make sure to call QWebEngine::initialize() in your main() function."); } m_shareContextQtQuick = make_scoped_refptr(new QtShareGLContext(shareContext)); } diff --git a/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp b/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp index f3792248e..cffdb74bc 100644 --- a/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp +++ b/src/webenginewidgets/api/qtwebenginewidgetsglobal.cpp @@ -42,8 +42,11 @@ #include "qtwebenginewidgetsglobal.h" #include "qtwebengineglobal.h" +#include <QCoreApplication> -void QWebEngineWidgets::initialize() +static void initialize() { QWebEngine::initialize(); } + +Q_COREAPP_STARTUP_FUNCTION(initialize) diff --git a/src/webenginewidgets/api/qtwebenginewidgetsglobal.h b/src/webenginewidgets/api/qtwebenginewidgetsglobal.h index 1836de357..d875c1cbe 100644 --- a/src/webenginewidgets/api/qtwebenginewidgetsglobal.h +++ b/src/webenginewidgets/api/qtwebenginewidgetsglobal.h @@ -55,12 +55,6 @@ 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/doc/snippets/simple/main.cpp b/src/webenginewidgets/doc/snippets/simple/main.cpp index d33f14628..bebdeff11 100644 --- a/src/webenginewidgets/doc/snippets/simple/main.cpp +++ b/src/webenginewidgets/doc/snippets/simple/main.cpp @@ -25,9 +25,6 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); QWidget *parent = 0; -//! [Initializing QWebEngineWidgets] - QWebEngineWidgets::initialize(); -//! [Initializing QWebEngineWidgets] //! [Using QWebEngineView] QWebEngineView *view = new QWebEngineView(parent); view->load(QUrl("http://qt-project.org/")); diff --git a/src/webenginewidgets/doc/src/qtwebenginewidgets.qdoc b/src/webenginewidgets/doc/src/qtwebenginewidgets.qdoc index fe43ca5c4..fa3954fb4 100644 --- a/src/webenginewidgets/doc/src/qtwebenginewidgets.qdoc +++ b/src/webenginewidgets/doc/src/qtwebenginewidgets.qdoc @@ -85,11 +85,6 @@ \section1 Architecture - Before an application can use the Qt WebEngine Widgets classes, it must call - the static initialization method for the module. - - \snippet snippets/simple/main.cpp Initializing QWebEngineWidgets - The easiest way to render content is through the QWebEngineView class. As a widget it can be embedded into your forms or a graphics view, and it provides convenience functions for downloading and rendering web sites. |