#include <QtQml/QQmlApplicationEngine>
#include <QtQuickControls2/QQuickStyle>
#include <QtQuick/QQuickWindow>
-#include <QtCore/QDir>
#include "eventhandler.h"
EventHandler *eventHandler = new EventHandler();
eventHandler->init(port, secret.toStdString().c_str());
engine.rootContext()->setContextProperty("eventHandler", eventHandler);
- QString qmldir = QCoreApplication::applicationDirPath();
- qmldir.replace(QString("bin"), QString("qml"));
- qmldir.append('/');
- qDebug() << "####qmldir=" << qmldir;
- engine.rootContext()->setContextProperty("qmldir", qmldir);
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
if (engine.rootObjects().isEmpty()) {
HMI_DEBUG(APP_ID, "Fatal Error, rootObject is empty!");
return -1;
}
- qDebug() << "####" << QDir::currentPath() << QCoreApplication::applicationDirPath();
QObject *root = engine.rootObjects().first();
QQuickWindow *window = qobject_cast<QQuickWindow *>(root);
height: 1487
property string onsId: qsTr("onscreenapp")
-// property string pri_path: qsTr("/home/0/app-data/OnScreen/qml/")
- property string pri_path: qmldir
+ property string pri_path: qsTr("/home/0/app-data/OnScreen/onstestapp/")
property string filepath: pri_path + qsTr("vics.qml")
property string msgdata: ""
property string postmsg: ""
ColumnLayout {
spacing: 20
- RowLayout {
- id: line1
- height: 80
- Label {
- id: guitype
- anchors.left: parent.left
- anchors.leftMargin: 10
- text: 'gui_type'
- font.pixelSize: 20
- color: '#00ADDC'
- }
-
- Label {
- text: qsTr("application")
- font.pixelSize: 20
- color: '#00ADDC'
- anchors.left: guitype.right
- anchors.leftMargin: 20
- }
- }
- RowLayout {
- id: line2
- spacing: 20
- Label {
- id: qmlpath
- anchors.left: parent.left
- anchors.leftMargin: 30
- text: qsTr("file")
- font.pixelSize: 20
- font.italic: true
- color: '#00ADDC'
- }
-
- TextInput {
- id: fpath
- text: filepath
- font.pixelSize: 20
- font.italic: true
- anchors.left: qmlpath.right
- anchors.leftMargin: 20
- color: '#00ADDC'
- cursorVisible: true
- inputMethodHints: Qt.ImhNone
- onFocusChanged: {
- console.log("filepath")
- if(fpath.focus)
- vkb.visible = true
- }
- }
- }
RowLayout {
id: line3
spacing: 20
}
function postMessage() {
- postmsg = "{\"gui\": \"application\", \"file\": \"" + filepath + "\"";
+ postmsg = "{\"file\": \"" + filepath + "\"";
if (data1.text != "") {
msgdata = "\"" + dataname1.text + "\":\"" + data1.text + "\"";
}
QMAKE_EXTRA_TARGETS += copy_config
PRE_TARGETDEPS += $$copy_config.target
-copy_qml.target = $$OUT_PWD/root/qml/
-copy_qml.depends = $$_PRO_FILE_PWD_/qml/.
-copy_qml.commands = $(COPY_DIR) \"$$replace(copy_qml.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qml.target, /, $$QMAKE_DIR_SEP)\"
-QMAKE_EXTRA_TARGETS += copy_qml
-PRE_TARGETDEPS += $$copy_qml.target
-
wgt.target = package
wgt.commands = wgtpkg-pack -f -o onstestapp.wgt root
## compile & install
- compile
- - when onscreenapp is compiled, this app's wgt file will exist at "onscreenapp/sample/package", called onstestapp.wgt.
+ - when onscreenapp is compiled, this app's wgt file will exist at "onscreenapp/sample/package" which called onstestapp.wgt.
- install
`afm-util install onstestapp.wgt;sync`
## dependence
-Onscreenapp depend on libhomescreen add agl-service-homescreen-2017 as below:
-- libhomescreen must have 'showWindow' event and 'showWindow' interface.
-- agl-service-homescreen-2017 must have 'showWindow/hideWindow/replyShowWindow' verbs.
-
+Onscreenapp depend on libhomescreen add agl-service-homescreen as below:
+- libhomescreen must have 'showWindow/hideWindow/replyShowWindow' event
+ and 'showWindow/hideWindow/replyShowWindow' interface.
+- agl-service-homescreen must have 'showWindow/hideWindow/replyShowWindow' verbs.
## usage
-Before start onstestapp you must copy all files in "ons" folder to "$HOME/app-data/OnScreen/qml" on your board(R-car M3 etc.),
+Before start onstestapp you must copy all files in "qml" folder to "$HOME/app-data/OnScreen/onstestapp/" on your board(R-car M3 etc.),
then do as below:
1. start onstestapp in launcher
- comment below contents in /etc/xdg/weston/weston.ini
- `#ivi-input-module=ivi-input-controller.so`
-- before press "Post" button, touch text area to call qt virtual keyboard and edit text.
+- before press "Post" button, touch text area to call keyboard and edit the text.