Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. The listview spend too much time to flick
Qt 6.11 is out! See what's new in the release blog

The listview spend too much time to flick

Scheduled Pinned Locked Moved QML and Qt Quick
8 Posts 3 Posters 4.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tigriswind
    wrote on last edited by
    #1

    i use the listview to show a list of page, every page show one picture;

    right now when i drag the listview, i find it spend too much time to flick!

    how can i accelerate the flicking speed ? or need i create a custom listview (i find it too hard to do that as the listview class in qml
    can not inherit).

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Chuck Gao
      wrote on last edited by
      #2

      Hi tigriswind,

      I think there is a couple of things you need check:

      1. Is the picture's size is too much to be loaded
      2. If the page hold the whole screen(which width maybe equal to the mainwindow's width), make sure the clip property of listview was set be true. It can ignore your pages out of the screen/range for rendering
      3. Make sure your code is correct for the case. :D

      Br

      Chuck

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tigriswind
        wrote on last edited by
        #3

        thanks for your reply;

        when i change the currentIndex for listview,every thing work well. but when i use drag to slide the

        listview, the speed is slow and the render performant is bad;

        after i deep into the declarative c++ source, i find the speed is according to multiple factors ,as the drag duration, the drag distance ......

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tigriswind
          wrote on last edited by
          #4

          you can find the similar source at qt/examples/declarative/toys/corkboards in the qt example

          1 Reply Last reply
          0
          • C Offline
            C Offline
            Chuck Gao
            wrote on last edited by
            #5

            Can you paste some code?

            Chuck

            1 Reply Last reply
            0
            • T Offline
              T Offline
              tigriswind
              wrote on last edited by
              #6

              Rectangle {
              width: 800; height: 480

              ListModel {
                  id: list
              
                  ListElement {
                      name: "Sunday"
                      notes: [
                          ListElement { noteText: "Lunch" },
                          ListElement { noteText: "Birthday Party" }
                      ]
                  }
              ...........................
                  ListElement {
                      name: "Saturday"
                      notes: [
                          ListElement { noteText: "Drink" },
                          ListElement { noteText: "Download Qt\nPlay with QML" }
                      ]
                  }
              }
              
              ListView {
                  id: flickable
              
                  anchors.fill: parent
                  focus: true
                  snapMode: ListView.SnapOneItem
                  highlightRangeMode: ListView.StrictlyEnforceRange
                  highlightMoveSpeed: 4000
                  orientation: ListView.Horizontal
                  model: list
                  delegate: Day { }
              }
              

              }

              //in the Day.qml only show a Image
              Component {
              ................
              Image {
              source: "cork.jpg"
              width: page.ListView.view.width
              height: page.ListView.view.height
              fillMode: Image.PreserveAspectCrop
              clip: true
              }
              ........................
              }

              1 Reply Last reply
              0
              • T Offline
                T Offline
                thisisbhaskar
                wrote on last edited by
                #7

                Place @ at the beginning and at the end of the code block. Its very difficult to read the code..

                1 Reply Last reply
                0
                • T Offline
                  T Offline
                  tigriswind
                  wrote on last edited by
                  #8

                  sorry

                  @
                  Rectangle {
                  width: 800; height: 480

                  ListModel {
                      id: list 
                      ListElement { 
                          name: “Sunday” 
                          notes: [ 
                                  ListElement { noteText: “Lunch” },
                                  ListElement { noteText: “Birthday Party” }
                                  ] 
                      }
                  
                      // ..........
                      ListElement { 
                          name: “Saturday” 
                          notes: [ 
                                  ListElement { noteText: “Drink” },
                                  ListElement { noteText: “Download Qt\nPlay with QML” } 
                                  ] 
                      }
                  } 
                  
                  ListView {
                      id: flickable 
                      anchors.fill: parent 
                      focus: true 
                      snapMode: ListView.SnapOneItem 
                      highlightRangeMode: ListView.StrictlyEnforceRange 
                      highlightMoveSpeed: 4000 
                      orientation: ListView.Horizontal 
                      model: list 
                      delegate: Day { }
                  }
                  

                  }

                  //in the Day.qml only show a Image
                  Component {
                  // ..........
                  Image {
                  source: “cork.jpg”
                  width: page.ListView.view. widht
                  height: page.ListView.view.height
                  fillMode: Image.PreserveAspectCrop
                  clip: true
                  }
                  // ..........
                  }
                  @

                  EDIT:
                  I reformatted the code, please wrap code sections in a single ( at the beginning of the block and one at the end, do not wrap every line. Please use correct indentation too, to increase its readability.
                  Volker

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved