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. How to know if ScrollView is at End?
Forum Updated to NodeBB v4.3 + New Features

How to know if ScrollView is at End?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 2 Posters 290 Views
  • 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.
  • A Offline
    A Offline
    Adso4
    wrote on last edited by
    #1

    I have several views with an scrollable area and I need to mark them as scrollable as long as there is an area below. This will be done showing an indicator as long as we are NOT at the end of the scrollable area.

    These scrollable views are done in different ways: scrollView, ListView, GridVew, Flickable, etc.

    I have seen that I can know if I'm at the end with "atYEnd" property, but this is only available for flickable-like types (listView, gridView).

    How can I achieve the same information in the case of ScrollView?

    ODБOïO 1 Reply Last reply
    0
    • A Adso4

      I have several views with an scrollable area and I need to mark them as scrollable as long as there is an area below. This will be done showing an indicator as long as we are NOT at the end of the scrollable area.

      These scrollable views are done in different ways: scrollView, ListView, GridVew, Flickable, etc.

      I have seen that I can know if I'm at the end with "atYEnd" property, but this is only available for flickable-like types (listView, gridView).

      How can I achieve the same information in the case of ScrollView?

      ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by
      #2

      Hi,
      @Adso4 said in How to know if ScrollView is at End?:

      How can I achieve the same information in the case of ScrollView?

      can be done like this

      Window {
          width: 800
          height: 600
          visible: true
      
          ScrollView {
              id:view
              width: 200
              height: 200
              clip: true
      
              property bool end : false
              onEndChanged: console.log("end : " + end )
      
              property var childRect  : view.contentItem.childrenRect
              property var _y : childRect.y
      
              on_YChanged: {
                  end = childRect.height + _y === view.height
              }
      
                Label {
                  id:first
                  text: "ABC"
                  font.pixelSize: 224
              }
          }
      }
      
      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