From: wang_zhiqiang Date: Mon, 3 Dec 2018 04:50:55 +0000 (+0800) Subject: change qml folder to X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=apps%2Fonscreenapp.git;a=commitdiff_plain;h=5e11084733c184b0505a4f4816e69b0dd363b653 change qml folder to --- diff --git a/sample/app/main.cpp b/sample/app/main.cpp index 69642dc..399a5c9 100644 --- a/sample/app/main.cpp +++ b/sample/app/main.cpp @@ -21,7 +21,6 @@ #include #include #include -#include #include "eventhandler.h" @@ -57,18 +56,12 @@ int main(int argc, char *argv[]) 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(root); diff --git a/sample/app/main.qml b/sample/app/main.qml index 94de871..5a70102 100644 --- a/sample/app/main.qml +++ b/sample/app/main.qml @@ -12,8 +12,7 @@ ApplicationWindow { 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: "" @@ -108,56 +107,6 @@ ApplicationWindow { 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 @@ -330,7 +279,7 @@ ApplicationWindow { } function postMessage() { - postmsg = "{\"gui\": \"application\", \"file\": \"" + filepath + "\""; + postmsg = "{\"file\": \"" + filepath + "\""; if (data1.text != "") { msgdata = "\"" + dataname1.text + "\":\"" + data1.text + "\""; } diff --git a/sample/package/package.pro b/sample/package/package.pro index 5a0c7d8..faf285c 100644 --- a/sample/package/package.pro +++ b/sample/package/package.pro @@ -13,12 +13,6 @@ copy_config.commands = $(COPY_FILE) \"$$replace(copy_config.depends, /, $$QMAKE_ 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 diff --git a/sample/package/qml/images/answer.png b/sample/qml/images/answer.png similarity index 100% rename from sample/package/qml/images/answer.png rename to sample/qml/images/answer.png diff --git a/sample/package/qml/images/disable.png b/sample/qml/images/disable.png similarity index 100% rename from sample/package/qml/images/disable.png rename to sample/qml/images/disable.png diff --git a/sample/package/qml/images/heart_1079x400.png b/sample/qml/images/heart_1079x400.png similarity index 100% rename from sample/package/qml/images/heart_1079x400.png rename to sample/qml/images/heart_1079x400.png diff --git a/sample/package/qml/images/images.qrc b/sample/qml/images/images.qrc similarity index 100% rename from sample/package/qml/images/images.qrc rename to sample/qml/images/images.qrc diff --git a/sample/package/qml/images/oval_1079x400.png b/sample/qml/images/oval_1079x400.png similarity index 100% rename from sample/package/qml/images/oval_1079x400.png rename to sample/qml/images/oval_1079x400.png diff --git a/sample/package/qml/images/reject.png b/sample/qml/images/reject.png similarity index 100% rename from sample/package/qml/images/reject.png rename to sample/qml/images/reject.png diff --git a/sample/package/qml/msg.qml b/sample/qml/msg.qml similarity index 100% rename from sample/package/qml/msg.qml rename to sample/qml/msg.qml diff --git a/sample/package/qml/phone.qml b/sample/qml/phone.qml similarity index 100% rename from sample/package/qml/phone.qml rename to sample/qml/phone.qml diff --git a/sample/package/qml/system.qml b/sample/qml/system.qml similarity index 100% rename from sample/package/qml/system.qml rename to sample/qml/system.qml diff --git a/sample/package/qml/vics.qml b/sample/qml/vics.qml similarity index 100% rename from sample/package/qml/vics.qml rename to sample/qml/vics.qml diff --git a/sample/readme.md b/sample/readme.md index 539f386..a48f3e0 100644 --- a/sample/readme.md +++ b/sample/readme.md @@ -5,21 +5,21 @@ A test application for onscreenapp ## 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 @@ -33,5 +33,5 @@ You also can edit the text which will post to onscreen, do as below: - 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.