diff options
author | Pierre Rossi <pierre.rossi@digia.com> | 2013-07-10 16:27:48 +0200 |
---|---|---|
committer | Pierre Rossi <pierre.rossi@gmail.com> | 2013-07-31 13:39:50 +0200 |
commit | 67d042d04f2b6cbe98f4eba2a50ed0d374165cae (patch) | |
tree | ff24cf732fa98750400a29354219ffbd70c84e1c /examples | |
parent | 519367a98334b658a93ed1ba096dba92858445c7 (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 'examples')
-rw-r--r-- | examples/common.pri | 1 | ||||
-rw-r--r-- | examples/examples.pro | 4 | ||||
-rw-r--r-- | examples/qtquick/main.cpp | 13 | ||||
-rw-r--r-- | examples/qtquick/qtquick.pro | 7 | ||||
-rw-r--r-- | examples/widgets/widgets.pro | 2 |
5 files changed, 16 insertions, 11 deletions
diff --git a/examples/common.pri b/examples/common.pri index b5fe6b5a0..dac92e865 100644 --- a/examples/common.pri +++ b/examples/common.pri @@ -8,7 +8,6 @@ HEADERS += common/util.h RESOURCES += $$absolute_path(common/common_resources.qrc) -LIBS += -L$$LIBPATH -lQt5WebEngine QMAKE_RPATHDIR += $$LIBPATH # Quick hack for now as we mess with that for the gyp generation step. diff --git a/examples/examples.pro b/examples/examples.pro index 4613dc8d8..eb04ac0ec 100644 --- a/examples/examples.pro +++ b/examples/examples.pro @@ -1,4 +1,4 @@ TEMPLATE=subdirs -SUBDIRS += qtquick \ - widgets +SUBDIRS += qtquick +qtHaveModule(widgets): SUBDIRS += widgets diff --git a/examples/qtquick/main.cpp b/examples/qtquick/main.cpp index ca92eb72c..982c1eb7a 100644 --- a/examples/qtquick/main.cpp +++ b/examples/qtquick/main.cpp @@ -40,14 +40,17 @@ ****************************************************************************/ #include "quickwindow.h" -#include "qquickwebcontentsview.h" -#include <QApplication> +#ifndef QT_NO_WIDGETS +#include <QtWidgets/QApplication> +typedef QApplication Application; +#else +#include <QtGui/QGuiApplication> +typedef QGuiApplication Application; +#endif int main(int argc, char **argv) { - QApplication app(argc, argv); - - QQuickWebContentsView::registerType(); + Application app(argc, argv); ApplicationEngine appEngine; diff --git a/examples/qtquick/qtquick.pro b/examples/qtquick/qtquick.pro index 88412e8bb..3b3e98cf1 100644 --- a/examples/qtquick/qtquick.pro +++ b/examples/qtquick/qtquick.pro @@ -9,5 +9,8 @@ SOURCES = quickwindow.cpp main.cpp OTHER_FILES += quickwindow.qml RESOURCES += resources.qrc -QT += quick \ - widgets # QApplication is required to get native styling with QtQuickControls + +QT += qml quick +qtHaveModule(widgets) { + QT += widgets # QApplication is required to get native styling with QtQuickControls +} diff --git a/examples/widgets/widgets.pro b/examples/widgets/widgets.pro index 3d0d17d7f..cf016402c 100644 --- a/examples/widgets/widgets.pro +++ b/examples/widgets/widgets.pro @@ -6,4 +6,4 @@ include(../common.pri) HEADERS = widgetwindow.h SOURCES = widgetwindow.cpp main.cpp -QT += widgets +QT += webenginewidgets |