summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKalle Viironen <kalle.viironen@digia.com>2014-05-26 13:52:23 +0300
committerKalle Viironen <kalle.viironen@digia.com>2014-05-26 13:52:28 +0300
commitec41c61fab5f20f52c2a7f1da9a7e2e552fc53d1 (patch)
tree8c220e410846744050738ad5709d8259cb2841ac
parent34bf5aeee929308c825395d6ddb8e62772bbf0cf (diff)
parent7cfc9355cb22e5ac92529b077215f36b60048d04 (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.qml10
-rw-r--r--qt_run.sh2
-rw-r--r--src/engine.h1
-rw-r--r--src/main.cpp12
-rw-r--r--startup.pro5
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 {
diff --git a/qt_run.sh b/qt_run.sh
index e439a55..e65d94f 100644
--- a/qt_run.sh
+++ b/qt_run.sh
@@ -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 \