Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.6.0, 5.7.0 Beta
-
None
-
Ubuntu 16.04, X11
-
240c2ef60e854575dced056d916f8a8922905e8f
Description
According to Flickable's documentation, widthRatio and heightRatio define
"the percentage of the full view currently visible, scaled to 0.0 - 1.0".
At the moment, defining leftMargin so that
leftMargin+contentWidth < flickable.width
causes widthRatio to be wrongly evaluated to something != 1, whereas it should be 1, because Flickable's defaults at -leftMargin
(see https://github.com/qtproject/qtdeclarative/blob/5.6/src/quick/items/qquickflickable.cpp#L1592 ).
and when contentX is -leftMargin, the whole content fits inside the view.
As a consequence of that, in the current implementation you can also scroll the item from the testcase left and right, which shouldn't be possible (because item+margin are still smaller than the view).
import QtQuick 2.0 Flickable { id: flickable width: 200 height: 200 contentWidth: item.width contentHeight: item.height topMargin: 20 leftMargin: 40 Component.onCompleted: console.log("xPos", flickable.visibleArea.xPosition, "widthRatio", flickable.visibleArea.widthRatio) Connections { target: flickable.visibleArea onXPositionChanged: console.log("xPosChanged", flickable.visibleArea.xPosition) onWidthRatioChanged: console.log("widthRatioChanged", flickable.visibleArea.widthRatio) } Rectangle { id: item width: 100 height: 100 color: "black" } }
Attachments
Issue Links
- relates to
-
QTBUG-31121 TextArea: when selectByMouse is false, the text area moves with the mouse
- Closed
-
QTBUG-83890 [REG 5.14.1->5.14.2,5.15] Horizontal Scrollbars in ScrollView when Flickable fits
- Closed
-
QTBUG-52553 No horizontal scrolling in ListView with long lines using Qt Quick 2.0
- Closed