SimpleListView.qml 575 B

123456789101112131415161718192021222324252627282930
  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 ? nativeUtils.imageCollection.retireIndex(index) : undefined
  17. }
  18. }
  19. model: nativeUtils.imageCollection
  20. Component.onCompleted: {
  21. nativeUtils.imageCollection.assumeLinearAccess()
  22. d.settled = true
  23. }
  24. }