|
23 | 23 | var prop = properties[i]; |
24 | 24 | if (prop.name == key) |
25 | 25 | { |
26 | | - return prop['value']; |
| 26 | + json = prop['value']; |
| 27 | + value = JSON.parse(json); |
| 28 | + return value.v; |
27 | 29 | } |
28 | 30 | } |
29 | 31 | return null; |
|
69 | 71 | var visible = getProperty(obj.properties, 'visible'); |
70 | 72 | nextParentWidget = obj; |
71 | 73 |
|
72 | | - if (visible == 'true') |
| 74 | + if (visible == true) |
73 | 75 | { |
74 | 76 | id = insertButton(idParent, x, y, width, height, getProperty(obj.properties, 'objectName'), showLayer); |
75 | 77 | insertText(id, obj.classchain[0], showLayer) |
|
80 | 82 | insertProperties(id, obj); |
81 | 83 | } |
82 | 84 | } |
83 | | - else if (isDerivedFrom(obj, 'QWidget')) |
| 85 | + else if (isDerivedFrom(obj, 'QWidget') || isDerivedFrom(obj, 'QQuickItem')) |
84 | 86 | { |
85 | 87 | var x = getProperty(obj.properties, 'x'); |
86 | 88 | var y = getProperty(obj.properties, 'y'); |
|
89 | 91 | var visible = getProperty(obj.properties, 'visible'); |
90 | 92 | nextParentWidget = obj; |
91 | 93 |
|
92 | | - if (visible == 'true') |
| 94 | + if (visible == true) |
93 | 95 | { |
94 | 96 | id = insertBox(idParent, x, y, width, height, showLayer); |
95 | 97 | insertText(id, obj.classchain[0], showLayer) |
|
107 | 109 | } |
108 | 110 | else if (isDerivedFrom(obj, 'QLayout')) |
109 | 111 | { |
110 | | - var visible = 'false'; |
| 112 | + var visible = false; |
111 | 113 | if (parentWidget) |
112 | 114 | { |
113 | 115 | visible = getProperty(parentWidget.properties, 'visible'); |
114 | 116 | } |
115 | | - if (visible == 'true') |
| 117 | + if (visible == true) |
116 | 118 | { |
117 | 119 | var x = getProperty(obj.properties, 'x'); |
118 | 120 | var y = getProperty(obj.properties, 'y'); |
|
180 | 182 |
|
181 | 183 | function getObjectTree() |
182 | 184 | { |
183 | | - g_fmqQtService.requestReply('finalmq.qt.GetObjectTreeRequest', null, function(outparams) { |
| 185 | + g_fmqQtService.requestReply('finalmq.qt.GetObjectTreeRequest', {levels:10}, function(outparams) { |
184 | 186 | if (outparams.fmqheader.status == 'STATUS_OK') |
185 | 187 | { |
186 | | - document.getElementById('root').innerHTML = ''; |
187 | | - iterateObjects(outparams.root, 0, 'root', null); |
| 188 | + document.getElementById('root').innerHTML = ''; |
| 189 | + iterateObjects(outparams.obj, 0, 'root', null); |
188 | 190 | } |
189 | 191 | }); |
190 | 192 | } |
191 | 193 |
|
192 | 194 | function getScreenshot() |
193 | 195 | { |
194 | | - g_fmqQtService.requestReply('finalmq.qt.GetScreenshotRequest', null, function(outparams) { |
| 196 | + g_fmqQtService.requestReply('QQuickRootItem;visible=true/grabToImage', null, function(outparams) { |
195 | 197 | if (outparams.fmqheader.status == 'STATUS_OK') |
196 | 198 | { |
197 | | - document.getElementById('image').innerHTML = '<img style="position:absolute; left:'+outparams.x+'; top:'+outparams.y+'; width:'+outparams.width+'; height:'+outparams.height+';" src="data:image/png;base64,'+outparams.screen+'"></img>' |
| 199 | + document.getElementById('image').innerHTML = '<img style="position:absolute; background-color:black; " src="data:image/png;base64,'+outparams.v+'"></img>' |
198 | 200 | } |
199 | 201 | }); |
200 | 202 | } |
|
204 | 206 | { |
205 | 207 | var inparams = {objectName:objectName}; |
206 | 208 | g_fmqQtService.requestReply('finalmq.qt.PressButtonRequest', inparams, function(outparams) { |
207 | | - var t=0; |
208 | 209 | }); |
209 | 210 | } |
210 | 211 |
|
|
219 | 220 | function pageLoad() |
220 | 221 | { |
221 | 222 | g_fmqSession.createSession(function() { |
222 | | - g_fmqQtService = g_fmqSession.createEntity('QtService'); |
| 223 | + g_fmqQtService = g_fmqSession.createEntity('QtAccessService'); |
223 | 224 | fmqReady(); |
224 | 225 | }); |
225 | 226 | } |
|
320 | 321 |
|
321 | 322 |
|
322 | 323 | <div style="position:absolute; top:0; left:0; width:100%; height:100%;"> |
323 | | - <div style="position:absolute; top:0; left:0; width:100%; height:100%;" id="image"> |
| 324 | + <div style="position:absolute; top:0; left:300; width:100%; height:100%; " id="image"> |
324 | 325 | </div> |
325 | | - <div style="position:absolute; top:0; left:0; width:100%; height:100%;" id="root"> |
| 326 | + <div style="position:absolute; top:0; left:300; width:100%; height:100%;" id="root"> |
326 | 327 | </div> |
327 | 328 | <table style="position:absolute; top:20%; left:0%;"> |
328 | 329 | <tr> |
|
0 commit comments