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. Tumbler does not load last element if model is 49, 98, 196, etc. in Qt 5.15

Tumbler does not load last element if model is 49, 98, 196, etc. in Qt 5.15

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 1 Posters 178 Views
  • 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.
  • A Offline
    A Offline
    aabacus
    wrote on last edited by
    #1

    Hi.

    I'm trying to create a simple tumbler with 49 elements, but the last element is not loaded or, at least, is not visible until I scroll the tumbler. I could reproduce this with models of 49, 98, 196... elements

    import QtQuick 2.15
    import QtQuick.Window 2.15
    import QtQuick.Controls 2.15
    
    Window {
        id: __root
        visible: true
        width: 460;
        height: 640
    
        Tumbler {
            id: hoursTumbler
            anchors.fill: parent
            model: 49
            visibleItemCount: 3
            delegate: Text {
                opacity: 1.0 - (Math.abs(Tumbler.displacement) / (Tumbler.tumbler.visibleItemCount / 2))
                font.pixelSize: hoursTumbler.height * 0.36
                text: index
            }
        }
    } //window
    

    Here is a running example in kde.org's online editor
    https://tinyurl.com/yd8hchsf

    What could be causing this?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      aabacus
      wrote on last edited by aabacus
      #2

      Hi again.

      This same behavior is described in this bug report: https://bugreports.qt.io/browse/QTBUG-90479
      But how is Tumbler related to PathView?

      I tried to load the model dynamically, to change the currentIndex dynamically, etc. but I get the same result.
      Do you have any idea or workaround?

      Thanks!

      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