Is it possible to make QML ListView cyclic?
I've implemented a simple list m开发者_Go百科odel and list delegate in QML, and now curious if it feasible to make the underlying list cyclic. Here is the code snippet:
Common.MarketsListView {
id: markets
anchors.top: logoImage.bottom
anchors.topMargin: 5
cacheBuffer: 20000
NumberAnimation on x {
running: runtime.isActiveWindow
loops: Animation.Infinite
from: 0
to: -300
duration: 20000
}
Currently, the list slowly moves to the left, but as it reaches the end only few last items are shown. So I shall either make the underlying list cyclic, or hard-code the jump to the first list item :(
You can't do this with a ListView, but you may be able to get the bahavior you want using PathView, e.g. https://doc.qt.io/archives/qt-4.7/declarative-ui-components-spinner.html
精彩评论