summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@digia.com>2014-01-29 11:20:03 +0100
committerTopi Reiniƶ <topi.reinio@digia.com>2014-01-30 13:30:51 +0200
commitb2957ef0efbf55872d36762705b62822cc828cf3 (patch)
tree84315730ce266b35360b7bc5730df1b05922c366
parent274baa15819458003555749d4e0509ac665f8526 (diff)
Enable virtual keyboard when building demos stand-alone
Add a shared QML file that defines an InputPanel and loads the main QML for each demo. Also, - Do not define QT_IM_MODULE (set already in the system) - Improved exclude file parsing to match b2qt-launcher Change-Id: Ibdd0371a57878ef7bc585aa67fcd148377f54bc6 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@digia.com>
-rw-r--r--basicsuite/about-b2qt/about-b2qt.pro1
-rw-r--r--basicsuite/camera/app.pro1
-rw-r--r--basicsuite/controls-touch/controls-touch.pro1
-rw-r--r--basicsuite/graphicaleffects/graphicaleffects.pro1
-rw-r--r--basicsuite/launchersettings/launchersettings.pro1
-rw-r--r--basicsuite/mediaplayer/mediaplayer.pro1
-rw-r--r--basicsuite/photogallery/photogallery.pro1
-rw-r--r--basicsuite/qt5-cinematicdemo/qt5-cinematicdemo.pro1
-rw-r--r--basicsuite/qt5-everywhere/app.pro1
-rw-r--r--basicsuite/qt5-launchpresentation/qt5-lauchpresentation.pro1
-rw-r--r--basicsuite/qt5-particlesdemo/qt5-particlesdemo.pro1
-rw-r--r--basicsuite/sensorexplorer/app.pro1
-rw-r--r--basicsuite/sensors/sensors.pro1
-rw-r--r--basicsuite/shared/loader.qml62
-rw-r--r--basicsuite/shared/main.cpp7
-rw-r--r--basicsuite/shared/shared.pri15
-rw-r--r--basicsuite/textinput/textinput.pro3
17 files changed, 92 insertions, 8 deletions
diff --git a/basicsuite/about-b2qt/about-b2qt.pro b/basicsuite/about-b2qt/about-b2qt.pro
index 175be57..a99c8e6 100644
--- a/basicsuite/about-b2qt/about-b2qt.pro
+++ b/basicsuite/about-b2qt/about-b2qt.pro
@@ -1,6 +1,7 @@
TARGET = about-b2qt
include(../shared/shared.pri)
+b2qtdemo_deploy_defaults()
content.files = \
*.qml \
diff --git a/basicsuite/camera/app.pro b/basicsuite/camera/app.pro
index 70633a5..b588a0d 100644
--- a/basicsuite/camera/app.pro
+++ b/basicsuite/camera/app.pro
@@ -1,6 +1,7 @@
TARGET = camera
include(../shared/shared.pri)
+b2qtdemo_deploy_defaults()
content.files = \
*.qml \
diff --git a/basicsuite/controls-touch/controls-touch.pro b/basicsuite/controls-touch/controls-touch.pro
index cf4b6fa..0a4ad03 100644
--- a/basicsuite/controls-touch/controls-touch.pro
+++ b/basicsuite/controls-touch/controls-touch.pro
@@ -1,6 +1,7 @@
TARGET = controls-touch
include(../shared/shared.pri)
+b2qtdemo_deploy_defaults()
content.files = \
*.qml \
diff --git a/basicsuite/graphicaleffects/graphicaleffects.pro b/basicsuite/graphicaleffects/graphicaleffects.pro
index 8f9c8cf..42e14ec 100644
--- a/basicsuite/graphicaleffects/graphicaleffects.pro
+++ b/basicsuite/graphicaleffects/graphicaleffects.pro
@@ -1,6 +1,7 @@
TARGET = graphicaleffects
include(../shared/shared.pri)
+b2qtdemo_deploy_defaults()
content.files = \
*.qml \
diff --git a/basicsuite/launchersettings/launchersettings.pro b/basicsuite/launchersettings/launchersettings.pro
index 1f9323e..bb0f2de 100644
--- a/basicsuite/launchersettings/launchersettings.pro
+++ b/basicsuite/launchersettings/launchersettings.pro
@@ -1,6 +1,7 @@
TARGET = launchersettings
include(../shared/shared.pri)
+b2qtdemo_deploy_defaults()
content.files = *.qml
content.path = $$DESTPATH
diff --git a/basicsuite/mediaplayer/mediaplayer.pro b/basicsuite/mediaplayer/mediaplayer.pro
index d0ce9e3..893539f 100644
--- a/basicsuite/mediaplayer/mediaplayer.pro
+++ b/basicsuite/mediaplayer/mediaplayer.pro
@@ -1,6 +1,7 @@
TARGET = mediaplayer
include(../shared/shared.pri)
+b2qtdemo_deploy_defaults()
content.files = \
*.qml \
diff --git a/basicsuite/photogallery/photogallery.pro b/basicsuite/photogallery/photogallery.pro
index 04c33f3..3b1476a 100644
--- a/basicsuite/photogallery/photogallery.pro
+++ b/basicsuite/photogallery/photogallery.pro
@@ -1,6 +1,7 @@
TARGET = photogallery
include(../shared/shared.pri)
+b2qtdemo_deploy_defaults()
content.files = \
*.qml \
diff --git a/basicsuite/qt5-cinematicdemo/qt5-cinematicdemo.pro b/basicsuite/qt5-cinematicdemo/qt5-cinematicdemo.pro
index eb67555..b4c5ae8 100644
--- a/basicsuite/qt5-cinematicdemo/qt5-cinematicdemo.pro
+++ b/basicsuite/qt5-cinematicdemo/qt5-cinematicdemo.pro
@@ -1,6 +1,7 @@
TARGET = qt5-cinematicdemo
include(../shared/shared.pri)
+b2qtdemo_deploy_defaults()
content.files = \
*.qml \
diff --git a/basicsuite/qt5-everywhere/app.pro b/basicsuite/qt5-everywhere/app.pro
index 6edb532..be46a9c 100644
--- a/basicsuite/qt5-everywhere/app.pro
+++ b/basicsuite/qt5-everywhere/app.pro
@@ -1,6 +1,7 @@
TARGET = qt5-everywhere
include(../shared/shared.pri)
+b2qtdemo_deploy_defaults()
content.files = \
*.qml \
diff --git a/basicsuite/qt5-launchpresentation/qt5-lauchpresentation.pro b/basicsuite/qt5-launchpresentation/qt5-lauchpresentation.pro
index 0a1a2b2..c3aba46 100644
--- a/basicsuite/qt5-launchpresentation/qt5-lauchpresentation.pro
+++ b/basicsuite/qt5-launchpresentation/qt5-lauchpresentation.pro
@@ -1,6 +1,7 @@
TARGET = qt5-launchpresentation
include(../shared/shared.pri)
+b2qtdemo_deploy_defaults()
content.files = \
*.qml \
diff --git a/basicsuite/qt5-particlesdemo/qt5-particlesdemo.pro b/basicsuite/qt5-particlesdemo/qt5-particlesdemo.pro
index 88e2467..29afc4f 100644
--- a/basicsuite/qt5-particlesdemo/qt5-particlesdemo.pro
+++ b/basicsuite/qt5-particlesdemo/qt5-particlesdemo.pro
@@ -1,6 +1,7 @@
TARGET = qt5-particlesdemo
include(../shared/shared.pri)
+b2qtdemo_deploy_defaults()
content.files = \
*.qml \
diff --git a/basicsuite/sensorexplorer/app.pro b/basicsuite/sensorexplorer/app.pro
index 5bf498d..bc968c2 100644
--- a/basicsuite/sensorexplorer/app.pro
+++ b/basicsuite/sensorexplorer/app.pro
@@ -1,6 +1,7 @@
TARGET = sensorexplorer
include(../shared/shared.pri)
+b2qtdemo_deploy_defaults()
content.files = *.qml
content.path = $$DESTPATH
diff --git a/basicsuite/sensors/sensors.pro b/basicsuite/sensors/sensors.pro
index bb1373e..0b431b8 100644
--- a/basicsuite/sensors/sensors.pro
+++ b/basicsuite/sensors/sensors.pro
@@ -1,6 +1,7 @@
TARGET = sensors
include(../shared/shared.pri)
+b2qtdemo_deploy_defaults()
content.files = \
*.qml \
diff --git a/basicsuite/shared/loader.qml b/basicsuite/shared/loader.qml
new file mode 100644
index 0000000..42232d2
--- /dev/null
+++ b/basicsuite/shared/loader.qml
@@ -0,0 +1,62 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc
+** All rights reserved.
+** For any questions to Digia, please use contact form at http://qt.digia.com
+**
+** This file is part of Qt Enterprise Embedded.
+**
+** Licensees holding valid Qt Enterprise licenses may use this file in
+** accordance with the Qt Enterprise License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.
+**
+** If you have questions regarding the use of this file, please use
+** contact form at http://qt.digia.com
+**
+****************************************************************************/
+import QtQuick 2.0
+import QtVkb 1.0
+
+Item {
+ id: root
+
+ Loader {
+ anchors.left: parent.left
+ anchors.top: parent.top
+ anchors.right: parent.right
+ anchors.bottom: inputPanel.top
+
+ source: "main.qml"
+ }
+
+ InputPanel {
+ id: inputPanel
+ z: 99
+ y: root.height
+ anchors.left: root.left
+ anchors.right: root.right
+
+ states: State {
+ name: "visible"
+ when: Qt.inputMethod.visible
+ PropertyChanges {
+ target: inputPanel
+ y: root.height - inputPanel.height
+ }
+ }
+ transitions: Transition {
+ from: ""
+ to: "visible"
+ reversible: true
+ ParallelAnimation {
+ NumberAnimation {
+ properties: "y"
+ duration: 250
+ easing.type: Easing.InOutQuad
+ }
+ }
+ }
+ }
+}
+
diff --git a/basicsuite/shared/main.cpp b/basicsuite/shared/main.cpp
index 748b22a..ac2fba4 100644
--- a/basicsuite/shared/main.cpp
+++ b/basicsuite/shared/main.cpp
@@ -22,6 +22,7 @@
#include <QtGui/QFontDatabase>
#include <QtGui/QScreen>
#include <QtGui/QPalette>
+#include <QtCore/QRegExp>
#include <QtQuick/QQuickView>
@@ -34,7 +35,7 @@
int main(int argc, char **argv)
{
- qputenv("QT_IM_MODULE", QByteArray("b2qtinputcontext"));
+ //qputenv("QT_IM_MODULE", QByteArray("qtvkb"));
QGuiApplication app(argc, argv);
QString path = app.applicationDirPath();
@@ -49,7 +50,7 @@ int main(int argc, char **argv)
QString target = qgetenv("B2QT_BASE") + "-" + qgetenv("B2QT_PLATFORM");
QFile excludeFile(path + QStringLiteral("/exclude.txt"));
if (excludeFile.open(QFile::ReadOnly)) {
- const QStringList excludeList = QString::fromUtf8(excludeFile.readAll()).split(":");
+ const QStringList excludeList = QString::fromUtf8(excludeFile.readAll()).split(QRegExp(":|\\s+"));
if (excludeList.contains(target))
qDebug("Warning: This example may not be fully functional on this platform");
excludeFile.close();
@@ -73,7 +74,7 @@ int main(int argc, char **argv)
view.rootContext()->setContextProperty("engine", &engine);
view.setColor(Qt::black);
view.setResizeMode(QQuickView::SizeRootObjectToView);
- view.setSource(QUrl::fromLocalFile(path + QStringLiteral("/main.qml")));
+ view.setSource(QUrl::fromLocalFile(path + QStringLiteral("/loader.qml")));
view.show();
app.exec();
diff --git a/basicsuite/shared/shared.pri b/basicsuite/shared/shared.pri
index 2ae3d3d..b785913 100644
--- a/basicsuite/shared/shared.pri
+++ b/basicsuite/shared/shared.pri
@@ -3,11 +3,18 @@ QT += quick
DESTPATH = /data/user/$$TARGET
target.path = $$DESTPATH
-excludeFile.files = exclude.txt
-excludeFile.path = $$DESTPATH
-INSTALLS += excludeFile
-
SOURCES += $$PWD/main.cpp \
$$PWD/engine.cpp
HEADERS += $$PWD/engine.h
+
+defineTest(b2qtdemo_deploy_defaults) {
+ commonFiles.files = \
+ exclude.txt \
+ ../shared/loader.qml
+ commonFiles.path = $$DESTPATH
+ OTHER_FILES += $${commonFiles.files}
+ INSTALLS += commonFiles
+ export(OTHER_FILES)
+ export(INSTALLS)
+}
diff --git a/basicsuite/textinput/textinput.pro b/basicsuite/textinput/textinput.pro
index a0f18c0..b5b97b2 100644
--- a/basicsuite/textinput/textinput.pro
+++ b/basicsuite/textinput/textinput.pro
@@ -1,9 +1,10 @@
TARGET = textinput
include(../shared/shared.pri)
+b2qtdemo_deploy_defaults()
content.files = \
- *.qml
+ *.qml \
*.png
content.path = $$DESTPATH