add forceLayout
This was an attempt at forcing the layout of the ListView so that it will adjust to model changes properly. It only sort of works. There are still occasional overlapping items.
This commit is contained in:
parent
e2e44f1c3c
commit
58a85bcc01
1 changed files with 12 additions and 0 deletions
|
@ -534,11 +534,13 @@ Item {
|
|||
|
||||
function removeItem(index) {
|
||||
ServiceItemModel.removeItem(index);
|
||||
serviceItemList.forceLayout()
|
||||
/* totalServiceItems--; */
|
||||
}
|
||||
|
||||
function removeItems() {
|
||||
ServiceItemModel.removeItems();
|
||||
serviceItemList.forceLayout()
|
||||
}
|
||||
|
||||
function addItem(index, type, itemID) {
|
||||
|
@ -550,6 +552,7 @@ Item {
|
|||
type, image.filePath,
|
||||
"image", "", "",
|
||||
"", 0, 0, false);
|
||||
serviceItemList.forceLayout()
|
||||
return;
|
||||
}
|
||||
case 'video': {
|
||||
|
@ -559,6 +562,7 @@ Item {
|
|||
type, video.filePath,
|
||||
"video", "", "",
|
||||
"", 0, 0, video.loop);
|
||||
serviceItemList.forceLayout()
|
||||
return;
|
||||
}
|
||||
case 'song': {
|
||||
|
@ -573,6 +577,7 @@ Item {
|
|||
song.backgroundType, lyrics,
|
||||
song.audio, song.font, song.fontSize,
|
||||
lyrics.length, true);
|
||||
serviceItemList.forceLayout()
|
||||
return;
|
||||
}
|
||||
case 'presentation': {
|
||||
|
@ -584,10 +589,12 @@ Item {
|
|||
type, pres.filePath,
|
||||
"image", "",
|
||||
"", "", 0, pres.pageCount, false);
|
||||
serviceItemList.forceLayout()
|
||||
return;
|
||||
}
|
||||
default: return;
|
||||
}
|
||||
serviceItemList.forceLayout()
|
||||
/* totalServiceItems++; */
|
||||
}
|
||||
|
||||
|
@ -600,6 +607,7 @@ Item {
|
|||
type, image.filePath,
|
||||
"image", "", "",
|
||||
"", 0, 0, false);
|
||||
serviceItemList.forceLayout()
|
||||
return;
|
||||
}
|
||||
case 'video': {
|
||||
|
@ -609,6 +617,7 @@ Item {
|
|||
type, video.filePath,
|
||||
"video", "", "",
|
||||
"", 0, 0, video.loop);
|
||||
serviceItemList.forceLayout()
|
||||
return;
|
||||
}
|
||||
case 'song': {
|
||||
|
@ -622,6 +631,7 @@ Item {
|
|||
song.backgroundType, lyrics,
|
||||
song.audio, song.font, song.fontSize,
|
||||
lyrics.length, true);
|
||||
serviceItemList.forceLayout()
|
||||
return;
|
||||
}
|
||||
case 'presentation': {
|
||||
|
@ -634,10 +644,12 @@ Item {
|
|||
"image", "",
|
||||
"", "", 0, pres.pageCount,
|
||||
false);
|
||||
serviceItemList.forceLayout()
|
||||
return;
|
||||
}
|
||||
default: return;
|
||||
}
|
||||
serviceItemList.forceLayout()
|
||||
}
|
||||
|
||||
function selectItems(index) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue