diff options
Diffstat (limited to 'basicsuite/shared')
-rw-r--r-- | basicsuite/shared/SharedMain.qml | 2 | ||||
-rw-r--r-- | basicsuite/shared/engine.h | 3 | ||||
-rw-r--r-- | basicsuite/shared/main.cpp | 15 | ||||
-rw-r--r-- | basicsuite/shared/shared.pri | 5 |
4 files changed, 23 insertions, 2 deletions
diff --git a/basicsuite/shared/SharedMain.qml b/basicsuite/shared/SharedMain.qml index 60a141b..98ca779 100644 --- a/basicsuite/shared/SharedMain.qml +++ b/basicsuite/shared/SharedMain.qml @@ -16,7 +16,7 @@ ** ****************************************************************************/ import QtQuick 2.0 -import QtQuick.Enterprise.VirtualKeyboard 1.0 +import QtQuick.Enterprise.VirtualKeyboard 1.1 Item { id: root diff --git a/basicsuite/shared/engine.h b/basicsuite/shared/engine.h index 1600fc6..43713c8 100644 --- a/basicsuite/shared/engine.h +++ b/basicsuite/shared/engine.h @@ -20,6 +20,8 @@ #include <QObject> #include <QSize> +#include <QString> +#include <QUrl> class QQmlEngine; class QQuickItem; @@ -36,6 +38,7 @@ class DummyEngine : public QObject public: explicit DummyEngine(QObject *parent = 0); + Q_INVOKABLE QUrl fromUserInput(const QString &userInput) { return QUrl::fromUserInput(userInput); } Q_INVOKABLE int smallFontSize() const { return qMax<int>(m_dpcm * 0.4, 10); } Q_INVOKABLE int fontSize() const { return qMax<int>(m_dpcm * 0.6, 14); } Q_INVOKABLE int titleFontSize() const { return qMax<int>(m_dpcm * 0.9, 20); } diff --git a/basicsuite/shared/main.cpp b/basicsuite/shared/main.cpp index d33b09c..d5b203f 100644 --- a/basicsuite/shared/main.cpp +++ b/basicsuite/shared/main.cpp @@ -34,14 +34,27 @@ #include <QtQml/QQmlContext> #include <QtQml/QQmlComponent> -#include "engine.h" +#if defined(USE_QTWEBENGINE) +#include <qtwebengineglobal.h> +#endif +#include "engine.h" int main(int argc, char **argv) { //qputenv("QT_IM_MODULE", QByteArray("qtvkb")); QApplication app(argc, argv); + + +#if defined(USE_QTWEBENGINE) + // This is currently needed by all QtWebEngine applications using the HW accelerated QQuickWebView. + // It enables sharing the QOpenGLContext of all QQuickWindows of the application. + // We have to do so until we expose a public API for it in Qt or choose to enable it + // by default earliest in Qt 5.4.0. + QWebEngine::initialize(); +#endif + QString path = app.applicationDirPath(); QPalette pal; diff --git a/basicsuite/shared/shared.pri b/basicsuite/shared/shared.pri index 8f66b7d..0d7392d 100644 --- a/basicsuite/shared/shared.pri +++ b/basicsuite/shared/shared.pri @@ -1,6 +1,11 @@ # widget dependecy is required by QtCharts demo QT += quick widgets +qtHaveModule(webengine) { + DEFINES += USE_QTWEBENGINE + QT += webengine +} + DESTPATH = /data/user/$$TARGET target.path = $$DESTPATH |