QML Tumbler Displacement

Viewed 30

Within the documentation for the Qt QML Tumbler Element in Qt 5.15 (https://doc.qt.io/qt-5/qml-qtquick-controls2-tumbler.html#displacement-attached-prop) the displacement property Tumbler.displacement is described as:

This attached property holds a value from -visibleItemCount / 2 to visibleItemCount / 2

However, when I print Tumbler.displacement within my delegate component I get values that are larger/smaller than visibleItemCount/2 . Does everyone experience the same?

In addition, the documentation is strange here as well. Because the following example is said to

the item below will be 40% opaque when it is not the current item, and transition to 100% opacity when it becomes the current item

And the JS looks as:

0.4 + Math.max(0, 1 - Math.abs(Tumbler.displacement)) * 0.6

Based on the text before the example, I'd have expected:

0.4 + Math.max(0, 1 - Math.abs(Tumbler.displacement)/(visibleItemCount/2.0)) * 0.6

Do you agree?

I came across all these, when I was facing the issue, that all delegates were printed on the same location fully overlapping each other. Somehow Qt is not able to place the items correctly (using Qt 5.15.2 and Quick Controls 2.15).

0 Answers
Related