Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
4.7.0
-
None
-
a60f8832425aafbe6c5e8be3c25fefc9f8f2f87b
Description
The intent is to create a ListView which always shows the last item in the list.
To reproduce:
Check out the self contained http://websvn.kde.org/trunk/KDE/kdepim/runtime/qml/kde/tests/qmlbreadcrumbnavigation/simple
svn co svn://anonsvn.kde.org/home/kde/trunk/KDE/kdepim/runtime/qml/kde/tests/qmlbreadcrumbnavigation/simple
build it.
The left panel is a QTreeView with two items. The right shows a QML scene with a ListView showing the second item. A timer fires after 2 seconds to prepend a new item in the list. The QML scene has a slot onCountChanged to keep the list scrolled to the bottom, but it does not work. The displayed item on the right is the second item instead of the first.
Note that you can hack the MainWindow.cpp to append instead of prepend, and that works. The view on the right does show the last item in the list.
kde-devel@chimera:~/kde/src/KDE/kdepimkomo/runtime/qml/kde/tests/qmlbreadcrumbnavigation/simple(master)$ git diff mainwindow.cpp
diff --git a/runtime/qml/kde/tests/qmlbreadcrumbnavigation/simple/mainwindow.cpp b/runtime/qml/kde/tests/qmlbreadcrumbnavigation/simple/mainwindow.cpp
index e04f845..ca1c781 100644
— a/runtime/qml/kde/tests/qmlbreadcrumbnavigation/simple/mainwindow.cpp
+++ b/runtime/qml/kde/tests/qmlbreadcrumbnavigation/simple/mainwindow.cpp
@@ -69,7 +69,7 @@ MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags f )
void MainWindow::prependNewRow()
void MainWindow::removeBottomRow()