SimpleListView.qml 657 B

12345678910111213141516171819202122232425262728293031323334
  1. import QtQuick 2.5
  2. import PictureModel 1.0
  3. // Forgive me
  4. import "../.."
  5. ListView {
  6. QtObject {
  7. id: d
  8. property bool settled: false
  9. }
  10. anchors.fill: parent
  11. delegate: Image {
  12. source: path
  13. height: size.height
  14. width: size.width
  15. Component.onDestruction: {
  16. d.settled ? globalUtil.imageModel.retireIndex(index) : undefined
  17. }
  18. }
  19. model: globalUtil.imageModel
  20. PictureModel {
  21. id: imageModel
  22. Component.onCompleted: {
  23. imageModel.assumeLinearAccess()
  24. globalUtil.imageModel = imageModel
  25. d.settled = true
  26. }
  27. }
  28. }