summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/webview/webview/main.cpp7
-rw-r--r--examples/webview/webview/webview.pro5
2 files changed, 12 insertions, 0 deletions
diff --git a/examples/webview/webview/main.cpp b/examples/webview/webview/main.cpp
index 7ae5d4f..4598b3f 100644
--- a/examples/webview/webview/main.cpp
+++ b/examples/webview/webview/main.cpp
@@ -47,6 +47,10 @@
#include <QQmlApplicationEngine>
#include <QtQml/QQmlContext>
+#ifdef QT_WEBVIEW_WEBENGINE_BACKEND
+#include <QtWebEngine>
+#endif // QT_WEBVIEW_WEBENGINE_BACKEND
+
// Workaround: As of Qt 5.4 QtQuick does not expose QUrl::fromUserInput.
class Utils : public QObject {
Q_OBJECT
@@ -68,6 +72,9 @@ QUrl Utils::fromUserInput(const QString& userInput)
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
+#ifdef QT_WEBVIEW_WEBENGINE_BACKEND
+ QtWebEngine::initialize();
+#endif // QT_WEBVIEW_WEBENGINE_BACKEND
QCommandLineParser parser;
QCoreApplication::setApplicationVersion(QT_VERSION_STR);
parser.setApplicationDescription("QtWebView Browser Example");
diff --git a/examples/webview/webview/webview.pro b/examples/webview/webview/webview.pro
index 77cbe78..e02757c 100644
--- a/examples/webview/webview/webview.pro
+++ b/examples/webview/webview/webview.pro
@@ -2,6 +2,11 @@ TEMPLATE = app
QT += qml quick
+qtHaveModule(webengine) {
+ QT += webengine
+ DEFINES += QT_WEBVIEW_WEBENGINE_BACKEND
+}
+
SOURCES += main.cpp
RESOURCES += qml.qrc