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. Listview index increments on screen rotation
Forum Updated to NodeBB v4.3 + New Features

Listview index increments on screen rotation

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 3 Posters 994 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.
  • L Offline
    L Offline
    literA2
    wrote on last edited by literA2
    #1

    Hi,

    Anyone encountered this issue? Any advise?

    Here is the sample ListView

      ListView {
        id: wizardList
    
        property int delegateArea
    
        anchors.fill: parent
        focus: true
        boundsBehavior: Flickable.StopAtBounds
        highlightRangeMode: ListView.StrictlyEnforceRange
        orientation: ListView.Horizontal
        snapMode: ListView.SnapOneItem
        cacheBuffer: delegateArea
        //model: wizardModel
    
       delegate: WizardDelegate {
          Component.onCompleted: {
            wizardList.delegateArea = width * height;
          }
        }
      }
    
    1. Flick the ListView to show item 2
    2. Rotate the screen from portrait to landscape
    3. item 2 is still the visible item
    4. Rotate again the screen from landscape to portrait
    5. The visible item is now item 3
      Once you repeat the process, step 5 always increments the index.

    I tried setting the cacheBuffer into 0, they same results when running the steps above.
    However, when I tried to flick back after the index increments, it won't increment anymore when changing orientation.

    Setting cacheBuffer to 0 it will affect the smothness when flicking items.

    Thanks.

    1 Reply Last reply
    0
    • L Offline
      L Offline
      literA2
      wrote on last edited by
      #2

      I found this the same issue before but it was tagged as out of scope. :(

      https://bugreports.qt.io/browse/QTBUG-20332?jql=text ~ "listview screen rotation"

      There's a comment stating that this works in QtQuick 2 however from my end it is still happening.

      Am i the only one experiencing this?

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Sumit Jadhav
        wrote on last edited by
        #3

        I'm facing same issue and its still reproducible in Qt 5.5.0 Android. I think it is reproduced when we do some heavy operations inside list delgate.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          HI guys,

          If you are still experiencing the behavior with Qt Quick 2 then please open a new report with a minimal compilable example that shows the behavior.

          However, you should first test it against the latest version of Qt. Currently 5.7

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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