Working move, and insert, added some changing of slides functionality

This commit is contained in:
Chris Cochrun 2022-03-30 11:39:43 -05:00
parent 105c958810
commit 9b6949090e
6 changed files with 73 additions and 51 deletions

View file

@ -10,11 +10,14 @@ import "./" as Presenter
Item {
id: root
property string text
property var text
property int textIndex: 0
property string itemType
property url imagebackground
property url vidbackground
Component.onCompleted: nextSlideText()
GridLayout {
anchors.fill: parent
columns: 3
@ -81,7 +84,6 @@ Item {
Layout.minimumWidth: 300
Layout.alignment: Qt.AlignCenter
textSize: width / 15
text: root.text
itemType: root.itemType
imageSource: imagebackground
videoSource: vidbackground
@ -95,7 +97,7 @@ Item {
Layout.alignment: Qt.AlignLeft
MouseArea {
anchors.fill: parent
onPressed: changeSlideNext()
onPressed: nextSlideText()
cursorShape: Qt.PointingHandCursor
}
}
@ -112,4 +114,24 @@ Item {
function loadVideo() {
previewSlide.loadVideo();
}
function nextSlideText() {
if (textIndex === 0) {
previewSlide.text = root.text[textIndex];
print(root.text[textIndex]);
textIndex++;
} else if (textIndex < root.text.length) {
previewSlide.text = root.text[textIndex];
print(root.text[textIndex]);
textIndex++;
} else {
print("Next slide time");
nextSlide();
textIndex = 0;
}
}
function nextSlide() {
print(slideItem);
}
}