@@ -56,6 +56,10 @@ Item {
56
56
}
57
57
}
58
58
}
59
+ if (__rootItem .menuKey !== " " && __rootItem .menuKey === __private .gotoMenuKey ) {
60
+ __rootItem .expandParent ();
61
+ __menuButton .clicked ();
62
+ }
59
63
}
60
64
61
65
required property var modelData
@@ -281,6 +285,7 @@ Item {
281
285
}
282
286
283
287
function gotoMenu (key ) {
288
+ __private .gotoMenuKey = key;
284
289
__private .gotoMenu (key);
285
290
}
286
291
@@ -293,29 +298,29 @@ Item {
293
298
294
299
function set (index , object ) {
295
300
if (index >= 0 && index < __listView .model .length ) {
296
- __listView .model [index] = object;
297
- __listView .modelChanged () ;
301
+ __private .model [index] = object;
302
+ __listView .model = __private . model ;
298
303
}
299
304
}
300
305
301
306
function setProperty (index , propertyName , value ) {
302
307
if (index >= 0 && index < __listView .model .length ) {
303
- __listView .model [index][propertyName] = value;
304
- __listView .modelChanged () ;
308
+ __private .model [index][propertyName] = value;
309
+ __listView .model = __private . model ;
305
310
}
306
311
}
307
312
308
313
function move (from , to , count = 1 ) {
309
314
if (from >= 0 && from < __listView .model .length && to >= 0 && to < __listView .model .length ) {
310
315
const objects = __listView .model .splice (from, count);
311
- __listView .model .splice (to, 0 , ... objects);
312
- __listView .modelChanged () ;
316
+ __private .model .splice (to, 0 , ... objects);
317
+ __listView .model = __private . model ;
313
318
}
314
319
}
315
320
316
321
function insert (index , object ) {
317
- __listView .model .splice (index, 0 , object);
318
- __listView .modelChanged () ;
322
+ __private .model .splice (index, 0 , object);
323
+ __listView .model = __private . model ;
319
324
}
320
325
321
326
function append (object ) {
@@ -325,12 +330,13 @@ Item {
325
330
326
331
function remove (index , count = 1 ) {
327
332
if (index >= 0 && index < __listView .model .length ) {
328
- __listView .model .splice (index, count);
329
- __listView .modelChanged () ;
333
+ __private .model .splice (index, count);
334
+ __listView .model = __private . model ;
330
335
}
331
336
}
332
337
333
338
function clear () {
339
+ __private .gotoMenuKey = ' ' ;
334
340
__listView .model = [];
335
341
}
336
342
@@ -445,6 +451,7 @@ Item {
445
451
Item {
446
452
id: __private
447
453
signal gotoMenu (key: string)
454
+ property string gotoMenuKey: ' '
448
455
property var model: []
449
456
property var window : Window .window
450
457
property var selectedItem: null
0 commit comments