Tumbler does not load last element if model is 49, 98, 196, etc. in Qt 5.15
Unsolved
QML and Qt Quick
-
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/yd8hchsfWhat could be causing this?
-
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!