Results 1 to 2 of 2

Thread: QML ListView atYEnd not emitted

  1. #1
    Join Date
    Apr 2015
    Location
    West Sussex, England
    Posts
    8
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default QML ListView atYEnd not emitted

    Hi All,

    Im using QtCreator and have written a basic QML test app to demonstrate an issue i've been seeing..

    Scenario:-
    ListView component with more delegates than can fit in to the view. Delegates (for this demo) consist of a green rectangle with a blue border. There is a red rectangle which we append to the end of this listview to indicate that there are more items below. This red rectangles visible property is bound to the list views atYEnd. So when we are at the very bottom of the list view, the red rectangle should be hidden; otherwise, we display it.

    Issue:-
    Flick (not drag) to the end of the listview and the red rectangle will still be visible. It seems the atYEnd is not emitted. If you were to then take note of the bottom delegates position and select and drag up, you'll notice that the delegate hasn't moved, yet the red rectangle has disappeared; meaning the atYEnd has been received.

    Has anyone come across this issue before and if so, did you find a work around to correctly detect the end of the list view?

    Thanks in advance,

    Rob.


    Qt Code:
    1. import QtQuick 1.1
    2.  
    3. FocusScope {
    4. id: main
    5.  
    6. width: 1280;
    7. height: 786;
    8.  
    9. Text {
    10. anchors.top: parent.top;
    11. anchors.topMargin: 20;
    12. anchors.horizontalCenter: parent.horizontalCenter;
    13. text: "Flick listview to the end and it wont emmit the atYEnd! Then touch and drag->no movement since its at the end but we do then get the atYEnd signal!";
    14. font.pixelSize: 16
    15. }
    16.  
    17. Rectangle { //Use this to show listview area
    18. anchors.fill: lstTestList;
    19. color: "pink";
    20. }
    21.  
    22. ListView {
    23. id: lstTestList;
    24. anchors.top: parent.top;
    25. anchors.topMargin: 100;
    26. anchors.horizontalCenter: parent.horizontalCenter;
    27.  
    28. width: 315;
    29. height: 400;
    30.  
    31. focus: true;
    32. clip: true;
    33.  
    34. snapMode: ListView.SnapToItem;
    35. boundsBehavior: ListView.StopAtBounds;
    36. highlightFollowsCurrentItem: true;
    37.  
    38. model: 7;
    39.  
    40. delegate: listViewDelegate;
    41.  
    42. Behavior on contentY {
    43. NumberAnimation {
    44. duration: main.timings.fastSlide;
    45. onRunningChanged: lstTestList.bListMoving = running
    46. }
    47. }
    48. }//listView
    49.  
    50. Component {
    51. id: listViewDelegate;
    52. FocusScope {
    53. id: listViewDelegateItem;
    54. width: childrenRect.width;
    55. height: 80;
    56.  
    57. Rectangle {
    58. width: 315;
    59. height: parent.height;
    60. border.width: 1;
    61. border.color: "blue";
    62. color: "green";
    63.  
    64. Text {
    65. anchors.centerIn: parent;
    66. text: "Delegate " + index
    67. }
    68. }
    69. }//item
    70. }//delegate component
    71.  
    72. Rectangle {
    73. id: rctListMoreIndicator;
    74. width: 315;
    75. height: 80;
    76.  
    77. visible: !lstTestList.atYEnd;
    78. anchors {
    79. top: lstTestList.bottom;
    80. left: lstTestList.left;
    81. }
    82. opacity: 1.0;
    83. color: "red";
    84.  
    85. Text {
    86. anchors.top: parent.top;
    87. anchors.topMargin: 20;
    88. anchors.horizontalCenter: parent.horizontalCenter;
    89. width: 300;
    90. wrapMode: Text.WordWrap;
    91. text: "This should not appear when we are at the very end of the listview"
    92. font.pixelSize: 16
    93. }
    94. } //rctListMoreIndicator
    95. } //Main.qml
    To copy to clipboard, switch view to plain text mode 
    a

  2. #2
    Join Date
    Apr 2015
    Location
    West Sussex, England
    Posts
    8
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: QML ListView atYEnd not emitted

    Just to update for anyone else that maybe seeing this issue. Upon further investigation, it appears that the issue is limited to QtQuick 1. Updating to QtQuick 2.x resolves this issue (although im stuck having to use QtQuick 1.1 for the time being ).

Similar Threads

  1. Signal can't be emitted !
    By Vladimir_ in forum Newbie
    Replies: 32
    Last Post: 27th September 2014, 20:31
  2. Signal isn't emitted from socket
    By 8Observer8 in forum Newbie
    Replies: 3
    Last Post: 14th August 2013, 13:33
  3. loadFinished() signal not emitted
    By sujan.dasmahapatra in forum Qt Programming
    Replies: 0
    Last Post: 27th June 2013, 12:21
  4. Signal emitted more than once?
    By dbrmik in forum Qt Programming
    Replies: 3
    Last Post: 13th March 2009, 12:44
  5. QWebPage::linkClicked() is only emitted once
    By Lykurg in forum Qt Programming
    Replies: 0
    Last Post: 20th November 2008, 12:56

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.