diff options
author | Kalle Viironen <kalle.viironen@digia.com> | 2014-05-26 13:52:23 +0300 |
---|---|---|
committer | Kalle Viironen <kalle.viironen@digia.com> | 2014-05-26 13:52:28 +0300 |
commit | ec41c61fab5f20f52c2a7f1da9a7e2e552fc53d1 (patch) | |
tree | 8c220e410846744050738ad5709d8259cb2841ac | |
parent | 34bf5aeee929308c825395d6ddb8e62772bbf0cf (diff) | |
parent | 7cfc9355cb22e5ac92529b077215f36b60048d04 (diff) |
Merge branch 'stable' into releaseQtEE_v3.0.0
* stable:
Auto-select a demo on startup as well as on movement stop
Add possibility to launch QtWebEngine applications
Change-Id: I54c688a28649b7dac0c3a40210695377bb75be6e
-rw-r--r-- | qml/LaunchScreen.qml | 10 | ||||
-rw-r--r-- | qt_run.sh | 2 | ||||
-rw-r--r-- | src/engine.h | 1 | ||||
-rw-r--r-- | src/main.cpp | 12 | ||||
-rw-r--r-- | startup.pro | 5 |
5 files changed, 28 insertions, 2 deletions
diff --git a/qml/LaunchScreen.qml b/qml/LaunchScreen.qml index 2bf25a5..ee518be 100644 --- a/qml/LaunchScreen.qml +++ b/qml/LaunchScreen.qml @@ -55,7 +55,7 @@ Item { offset: list.contentX; - onClicked: { + function select() { list.targetContentX = iconRoot.x - (list.width / 2 - list.cellWidth / 2); list.targetIndex = index; if (Math.abs(list.targetContentX - list.contentX) < 50) { @@ -65,6 +65,7 @@ Item { } animateToCenter.running = true; } + onClicked: select() } property int targetIndex; @@ -84,6 +85,13 @@ Item { nameLabel.text = "" } } + + onMovementEnded: { + var center = mapToItem(contentItem, width / 2, height / 2) + itemAt(center.x, center.y).select() + } + + onCountChanged: if (count > 0 && currentIndex < 0) currentIndex = 0 } Text { @@ -6,4 +6,4 @@ export QT_QPA_EGLFS_HIDECURSOR=1 export QMLSCENE_DEVICE=customcontext export CUSTOMCONTEXT_NO_MULTISAMPLE=1 -/system/bin/qtlauncher -plugin evdevtouch:/dev/input/event0 --logcat +/system/bin/qtlauncher -plugin evdevtouch:/dev/input/event0 --logcat --single-process diff --git a/src/engine.h b/src/engine.h index 89fa28d..a837879 100644 --- a/src/engine.h +++ b/src/engine.h @@ -71,6 +71,7 @@ public: void setWindow(QQuickWindow *window) { m_window = window; } + Q_INVOKABLE QUrl fromUserInput(const QString& userInput) { return QUrl::fromUserInput(userInput); } Q_INVOKABLE int sensibleButtonSize() const; Q_INVOKABLE int titleBarSize() const; Q_INVOKABLE int smallFontSize() const { return qMax<int>(m_dpcm * 0.4, 10); } diff --git a/src/main.cpp b/src/main.cpp index 60ec4d7..3df76b6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -32,6 +32,10 @@ #include <QtQml/QQmlContext> #include <QtQml/QQmlComponent> +#if defined(USE_QTWEBENGINE) +#include <qtwebengineglobal.h> +#endif + #include "engine.h" #include "applicationsmodel.h" #include "logmanager.h" @@ -64,6 +68,14 @@ int main(int argc, char **argv) { 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 + QPalette pal; pal.setColor(QPalette::Text, Qt::black); pal.setColor(QPalette::WindowText, Qt::black); diff --git a/startup.pro b/startup.pro index 661ac49..0c9283a 100644 --- a/startup.pro +++ b/startup.pro @@ -9,6 +9,11 @@ TARGET = qtlauncher QML_FILES += qml +qtHaveModule(webengine) { + DEFINES += USE_QTWEBENGINE + QT += webengine +} + HEADERS += \ src/engine.h \ src/applicationsmodel.h \ |