fixing more inserting pieces

This commit is contained in:
Chris Cochrun 2023-09-13 14:58:44 -05:00
parent 4499d1a957
commit f2f2ab27b9
2 changed files with 17 additions and 10 deletions

View file

@ -557,8 +557,8 @@ Item {
const image = imageProxyModel.getImage(itemID); const image = imageProxyModel.getImage(itemID);
console.log("adding: " + image.title + " of type " + type); console.log("adding: " + image.title + " of type " + type);
ServiceItemModel.insertItem(index, image.title, ServiceItemModel.insertItem(index, image.title,
type, image.filePath, "", type, image.filePath,
"image", "", "", "image", "",
"", 0, 0, false, 0.0, 0.0); "", 0, 0, false, 0.0, 0.0);
serviceItemList.forceLayout() serviceItemList.forceLayout()
return; return;
@ -567,8 +567,8 @@ Item {
const video = videoProxyModel.getVideo(itemID); const video = videoProxyModel.getVideo(itemID);
console.log("adding: " + video.title + " of type " + type); console.log("adding: " + video.title + " of type " + type);
ServiceItemModel.insertItem(index, video.title, ServiceItemModel.insertItem(index, video.title,
type, video.filePath, "", type, video.filePath,
"video", "", "", "video", "",
"", 0, 0, video.loop, video.startTime, video.endTime); "", 0, 0, video.loop, video.startTime, video.endTime);
serviceItemList.forceLayout() serviceItemList.forceLayout()
return; return;
@ -581,8 +581,8 @@ Item {
" of type " + type + " of type " + type +
" with " + lyrics.length + " slides"); " with " + lyrics.length + " slides");
ServiceItemModel.insertItem(index, song.title, ServiceItemModel.insertItem(index, song.title,
type, song.background, lyrics, type, song.background,
song.backgroundType, lyrics, song.backgroundType,
song.audio, song.font, song.fontSize, song.audio, song.font, song.fontSize,
lyrics.length, true, 0.0, 0.0); lyrics.length, true, 0.0, 0.0);
serviceItemList.forceLayout() serviceItemList.forceLayout()
@ -594,8 +594,8 @@ Item {
" of type " + type + " of type " + type +
" with " + pres.pageCount + " slides"); " with " + pres.pageCount + " slides");
ServiceItemModel.insertItem(index, pres.title, ServiceItemModel.insertItem(index, pres.title,
type, pres.filePath, "", type, pres.filePath,
"image", "", "image",
"", "", 0, pres.pageCount, false, 0.0, 0.0); "", "", 0, pres.pageCount, false, 0.0, 0.0);
serviceItemList.forceLayout() serviceItemList.forceLayout()
return; return;

View file

@ -260,6 +260,13 @@ mod slide_model {
index: i32, index: i32,
service_item: &QMap_QString_QVariant, service_item: &QMap_QString_QVariant,
) { ) {
for (key, data) in service_item.iter() {
println!(
"{:?}: {:?}",
key,
data.value_or_default::<QString>()
);
}
let ty = service_item let ty = service_item
.get(&QString::from("ty")) .get(&QString::from("ty"))
.unwrap_or(QVariant::from(&QString::from(""))) .unwrap_or(QVariant::from(&QString::from("")))
@ -386,7 +393,7 @@ mod slide_model {
slide.video_background = QString::from(""); slide.video_background = QString::from("");
slide.slide_index = 0; slide.slide_index = 0;
self.as_mut().insert_slide(&slide, slide_index); self.as_mut().insert_slide(&slide, slide_index);
println!("Item added in rust model!"); println!("Image added to slide model!");
} }
Some(ty) if ty == QString::from("song") => { Some(ty) if ty == QString::from("song") => {
let count = text_vec.len(); let count = text_vec.len();
@ -439,7 +446,7 @@ mod slide_model {
_ => println!("It's somethign else!"), _ => println!("It's somethign else!"),
}; };
println!("Item added in rust model!"); println!("Item added in slide model!");
} }
#[qinvokable] #[qinvokable]