Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.7.0
-
None
Description
This is a regression from Qt 4.
This makes a scroll bar based on contentY position incorrectly. Workaround is to anchor to the root object. Output of program below is
qml: onContentYChanged -304.79999999999995
import QtQuick 2.0 Item{ width: 569; height: 762 Rectangle{//NO PROBLEM IF WE COMMENT THIS Rectangle OUT anchors.fill: parent ListView{ id: listView anchors{fill: parent; topMargin: 1}//NO PROBLEM WITH topMargin: 0 onContentYChanged: print('onContentYChanged', contentY) model: 10 delegate: Text{ width: listView.width; height: listView.height / 5 text: modelData } Rectangle{//scrollbar color: 'red' width: 0.01 * parent.width; radius: width / 2 anchors{right: parent.right; margins: radius} height: Math.max(parent.height / parent.contentHeight * parent.height - 2 * radius, 20)//minimum height for large lists y: parent.contentY / parent.contentHeight * parent.height + radius visible: parent.height < parent.contentHeight } } } }
Attachments
Issue Links
- relates to
-
QTBUG-31905 Flickable ignores margins when determining the flick direction
- Closed