[solved] Flickable element, contentHeight and visibleArea.heightRatio greater than one



  • I am facing strange situation. Value of visibleArea.heightRatio property of my Flickable element is greater than 1.0.
    I assume that it should be in range 0.0 to 1.0.

    Here is part of my code
    @
    ...
    Flickable {
    id: flickArea
    anchors.top: parent.top
    anchors.bottom: okButton.top
    anchors.left: parent.left
    anchors.right: parent.right
    //flickableDirection: Flickable.VerticalFlick
    contentHeight: {
    console.log("h " + searchLevelHeader.height + " " + textSizeChooser.height + " " + defaultDictHeader.height
    + " " + height)
    return searchLevelHeader.height + textSizeChooser.height + defaultDictHeader.height + 30
    }
    clip: true
    ...
    @
    I place three elements in my Flickable element and present scrollbar according to visibleArea.heightRatio property, but its value is greater than 1.0 when contentHeight is less then Flickable height.
    I anchor these three elements to parent and Flickable is placed in Rectangle element.

    Does anyone have idea what can be wrong?



  • Hmm, ok this was a silly question.
    If I set by myself contentHeight value to value less than Flickable element height then visibleArea.heightRatio must be greater than one:
    visibleArea.heightRatio = height/contentHeight.

    PS Must write questions on the paper before posting to the forum :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.