ArtImage.qml 612 B

1234567891011121314151617181920212223242526
  1. import QtQuick 2.5
  2. import PictureModel 1.0
  3. Image {
  4. property var effect
  5. property int modelIndex
  6. asynchronous: true
  7. fillMode: Image.PreserveAspectFit
  8. //fillMode: Image.PreserveAspectCrop
  9. source: imageModel.data(modelIndex)
  10. height: width/imageModel.data(modelIndex, PictureModel.RatioRole)
  11. width: parent.width
  12. mirror: globalSettings.randomlyMirrorArt && (Math.random() < 0.5)
  13. smooth: globalSettings.smoothArt
  14. sourceSize.height: height
  15. sourceSize.width: width
  16. Component.onCompleted: {
  17. modelIndex = Math.floor(Math.random()*imageModel.count)
  18. }
  19. }