0

hello how o create list view that start again at end like (0-1-2-3...8-9-0-1-2) like loop i used tumbler but it have some problem i need something like tumbler +wrap...........................................................................................................................................................................................

import QtQuick 2.12 
import QtQuick.Layouts 1.12 
import Qt.labs.folderlistmodel 2.12

 Flickable{
    width: 180; height: 200; color: "white"
    
          Component {
              id: delegate
              Item {
                  id: wrapper
                  width: 180; height: 40
                  Column {
                      x: 5; y: 5
                      Text { text: '<b>Name:</b> ' + name }
                     
                  }
              }
          }
    
          ListView {
              width: parent.width; height: parent.height
              delegate: delegate
              focus: true
              model: ListModel {
                  id: contactModel
                  ListElement {
                      name: "1"
                      
                  }
                  ListElement {
                      name: "2"
                  }
                  ListElement {
                      name: "3"
                     
                  }
                  ListElement {
                      name: "4"
                     
                  }
                  ListElement {
                      name: "5"
                      
                  }
                  ListElement {
                      name: "6"
                      
                  }
                  ListElement {
                      name: "7"
                     
                  }
                  ListElement {
                      name: "8"
                      
                  }
                  ListElement {
                      name: "9"
                     
                  
                 
                  }
              }
          }
      }
  • 1
    What problems do you have with tumbler with wrap:true property? What difference are you expecting? – Nikxp Mar 04 '21 at 08:10
  • 1
    To make cycled list you need to use PathView. List view is not intended to have such functionality. – Maxim Skvortsov Mar 04 '21 at 09:40
  • both pathview and tumbler are slow i tryed them as out put for my project when value changed too fast they get buggy they doest update with value speed – amir ahmadi Mar 04 '21 at 18:59
  • Perhaps you should ask a question about that then? `ListView` would not work with infinite amount of items nor will it be faster in that case. That is literally why `Tumbler` exists (probably). Alternatively you can write your own tumbler by setting "y" property of items - well, good luck with that..... – Jack White Mar 05 '21 at 04:38

0 Answers0