Skip to content

Commit

Permalink
fix: undefine "setCurrentIndex" error
Browse files Browse the repository at this point in the history
explicitly specify the object of function

Log:
  • Loading branch information
FeiWang1119 authored and BLumia committed Sep 11, 2024
1 parent 522fd3a commit 3e142f8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions qml/FullscreenFrame.qml
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ InputEventItem {
if (isLastPage && !dropArea.createdEmptyPage) {
let newPageIndex = ItemArrangementProxyModel.creatEmptyPage()
dropArea.createdEmptyPage = true
setCurrentIndex(newPageIndex)
listviewPage.setCurrentIndex(newPageIndex)
parent.pageIntent = 0
return
} else {
Expand Down Expand Up @@ -366,7 +366,7 @@ InputEventItem {
Keys.onLeftPressed: function(event) {
if (listItem.viewIndex === 0 && itemPageModel.rowCount() > 1) {
// is the 1st page, go to last page
setCurrentIndex(itemPageModel.rowCount() - 1)
listviewPage.setCurrentIndex(itemPageModel.rowCount() - 1)
} else {
// not the 1st page, simply use SwipeView default behavior
event.accepted = false
Expand All @@ -375,7 +375,7 @@ InputEventItem {
Keys.onRightPressed: function(event) {
if (listItem.viewIndex === (itemPageModel.rowCount() - 1) && itemPageModel.rowCount() > 1) {
// is the last page, go to last page
setCurrentIndex(0)
listviewPage.setCurrentIndex(0)
} else {
// not the last page, simply use SwipeView default behavior
event.accepted = false
Expand Down Expand Up @@ -502,7 +502,7 @@ InputEventItem {
}

Component.onCompleted: {
setCurrentIndex(0)
listviewPage.setCurrentIndex(0)
}
}

Expand Down Expand Up @@ -685,7 +685,7 @@ InputEventItem {
// reset(remove) keyboard focus
baseLayer.focus = true
// reset page to the first page
setCurrentIndex(0)
listviewPage.setCurrentIndex(0)
}
}
}
Expand Down

0 comments on commit 3e142f8

Please sign in to comment.