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. flickableItem.atYEnd is false even at the bottom of scroll
Forum Updated to NodeBB v4.3 + New Features

flickableItem.atYEnd is false even at the bottom of scroll

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 168 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.
  • C Offline
    C Offline
    cebuger
    wrote on last edited by
    #1

    I have a ListView which is inside a ScrollView and I want to know or listen when the scroll bar is scrolled to the bottom,

       ScrollView {
                            id: moderatorMessagesScrollViewID
    
                            anchors.fill: parent
    
                            function update()
                            {
    							console.debug("<< moderatorMessagesScrollViewID ScrollView::update ", flickableItem.atYEnd);
    	                }
    
                            flickableItem.onAtYBeginningChanged: {
                                update();
                            }
    
                            flickableItem.onAtYEndChanged: {
                                update();
                            }
    
                            flickableItem.onContentYChanged: {
                                update();
                            }
    
                            ListView {
                                id: moderatorMessagesList
                                anchors.leftMargin: 15
                                anchors.rightMargin: 15
                                anchors.bottomMargin: 5
                                layoutDirection: Qt.LeftToRight
                                orientation: ListView.Vertical
                                verticalLayoutDirection: ListView.BottomToTop
                                cacheBuffer: (chatPanel.height <= 0) ? 1000 : (chatPanel.height * 1000)
                                spacing: 0
                                focus: true
    
                                Component.onCompleted: {
                                    updateView();
                                }
    
                                delegate: messageListDelegate
                            }
    
                            style: ScrollViewStyle {
                                incrementControl: Rectangle {
                                    visible: false
                                    implicitWidth: 0
                                    implicitHeight: 0
                                }
                                decrementControl: Rectangle {
                                    visible: false
                                    implicitWidth: 0
                                    implicitHeight: 0
                                }
                                corner: Rectangle {
                                    color: "white"
                                    visible: true
                                    rotation: 180
                                }
                                handle: Rectangle {
                                    implicitWidth: 5 * MyStyle.props.scrollSizeFactor()
                                    implicitHeight: 7 * MyStyle.props.scrollSizeFactor()
                                    color: Qt.rgba(237/255, 237/255, 237/255, 1)
                                    radius: 2
                                    border.width: 1
                                    border.color: "#C3C3C3"
                                }
                                scrollToClickedPosition: true
                                handleOverlap: 1
                                scrollBarBackground: Rectangle {
                                    width: 5 * MyStyle.props.scrollSizeFactor()
                                    height: 10 * MyStyle.props.scrollSizeFactor()
                                    color: MyStyle.props.color("chatChatPanelBackground")
                                }
                                transientScrollBars: false
                            }
                        }
                    }
    

    but my issue here is
    (1) flickableItem.atYEnd is always false
    (2) flickableItem.onAtYEndChanged is not triggered even if I scroll at the bottom
    (3) update() is triggered by onContentYChanged() instead when i try to scroll using scrollbar.

    What is wrong with this and what areas I need to look into?

    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