2 import QtQuick.Window 2.2
3 import QtQuick.Controls 2.0
4 import QtQuick.Layouts 1.0
5 import QtQuick.VirtualKeyboard 2.1
14 property string onsId: qsTr("onscreenapp")
15 property string pri_path: qsTr("/home/0/app-data/OnScreen/qml/")
16 property string filepath: pri_path + qsTr("vics.qml")
17 property string msgdata: ""
18 property string postmsg: ""
24 text: "OnScreen Test App"
30 anchors.top: title.bottom
32 anchors.horizontalCenter: title.horizontalCenter
34 // show received reply information area
39 Layout.alignment: Qt.AlignCenter
41 TextArea.flickable: TextArea {
43 text: "show received reply information area\n...\n...\n...\n...\n"
45 wrapMode: TextArea.Wrap
48 ScrollBar.vertical: ScrollBar { }
51 // select onscreen type area
53 title: "Please select send OnScreen Type"
58 Layout.alignment: Qt.AlignLeft
68 console.log("clicked:", "VICS")
76 console.log("clicked:", "SYS")
84 console.log("clicked:", "TEL")
92 console.log("clicked:", "MSG")
98 // edit post message area
101 title: "Please input parameter to onscreen"
106 Layout.alignment: Qt.AlignLeft
115 anchors.left: parent.left
116 anchors.leftMargin: 10
123 text: qsTr("application")
126 anchors.left: guitype.right
127 anchors.leftMargin: 20
135 anchors.left: parent.left
136 anchors.leftMargin: 30
148 anchors.left: qmlpath.right
149 anchors.leftMargin: 20
152 inputMethodHints: Qt.ImhNone
154 console.log("filepath")
165 anchors.left: parent.left
166 anchors.leftMargin: 30
175 text: qsTr("tokyo vics information!")
178 anchors.left: dataname1.right
179 anchors.leftMargin: 20
182 inputMethodHints: Qt.ImhNone
184 console.log("OnScreenData1")
196 anchors.left: parent.left
197 anchors.leftMargin: 30
209 anchors.left: dataname2.right
210 anchors.leftMargin: 20
213 inputMethodHints: Qt.ImhNone
215 console.log("OnScreenData2")
227 anchors.left: parent.left
228 anchors.leftMargin: 30
240 anchors.left: dataname3.right
241 anchors.leftMargin: 20
244 inputMethodHints: Qt.ImhNone
246 console.log("OnScreenData3")
259 Layout.alignment: Qt.AlignCenter
261 console.log("poster pressed")
271 anchors.right: parent.right
272 anchors.left: parent.left
273 anchors.bottom: parent.bottom
275 if(!active) { visible = false; }
279 function selectVICS() {
280 filepath = pri_path + "vics.qml";
281 dataname1.text = "info"
282 data1.text = "tokyo vics information!"
288 line4.visible = false
289 line5.visible = false
292 function selectSYS() {
293 filepath = pri_path + "system.qml";
294 dataname1.text = "type"
295 data1.text = "system error"
296 dataname2.text = "text"
297 data2.text = "System Error Occured!"
302 line5.visible = false
305 function selectTEL() {
306 filepath = pri_path + "phone.qml";
307 dataname1.text = "status"
308 data1.text = "Call Answered"
314 line4.visible = false
315 line5.visible = false
318 function selectMSG() {
319 filepath = pri_path + "msg.qml";
320 dataname1.text = "data1"
321 data1.text = "from testApp data1"
322 dataname2.text = "data2"
323 data2.text = "from testApp data2"
324 dataname3.text = "data3"
325 data3.text = "from testApp data3"
331 function postMessage() {
332 postmsg = "{\"gui\": \"application\", \"file\": \"" + filepath + "\"";
333 if (data1.text != "") {
334 msgdata = "\"" + dataname1.text + "\":\"" + data1.text + "\"";
336 if (data2.text !="") {
339 msgdata += "\"" + dataname2.text + "\":\"" + data2.text + "\"";
341 if (data3.text !="") {
344 msgdata += "\"" + dataname3.text + "\":\"" + data3.text + "\"";
347 postmsg += ",\"data\":{" + msgdata + "}}"
351 eventHandler.showWindow(onsId, postmsg);
354 function qmlOnReplyShowWindow(text) {
355 console.log("onstestapp received:",text);