~mterry/unity8/fix-emulator-tutorial

Viewing all changes in revision 1923.

  • Committer: CI Train Bot
  • Author(s): Alberto Mardegan
  • Date: 2015-08-17 11:57:13 UTC
  • mfrom: (1916.1.3 lp1433442)
  • Revision ID: ci-train-bot@canonical.com-20150817115713-ymoukvxd23ll2jb8
Set currentIndex after the model change is completed

When setting the model, the list view will first emit the countChanged signal, then will change the currentIndex to 0 (see QtDeclarative git commit 22c6873 and https://bugreports.qt.io/browse/QTBUG-26604), and finally will emit the modelChanged signal.
If we set the currentIndex in the onCountChanged handler (as we were doing
before), the currentIndex would be reset to 0 shortly afterwards.

For some mysterious reason, the desired delegate was anyway shown until the bugfix for bug 1433442 was introduced; with that bugfix, the listview is more consistent and shows the delegate corresponding to the currentIndex. Fixes: #1433442

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: