Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [solved] Flickable element, contentHeight and visibleArea.heightRatio greater than one
Qt 6.11 is out! See what's new in the release blog

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

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 1 Posters 3.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MichK
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      MichK
      wrote on last edited by
      #2

      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 :)

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved