main.qml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import QtQuick 2.5
  2. import QtQuick.Window 2.2
  3. import Qt.labs.settings 1.0
  4. Window {
  5. id: appWindow
  6. width: 1024
  7. height: 768
  8. Settings {
  9. id: settings
  10. property int itemTravel: 0
  11. property int columnCount: 5
  12. property int interval: 5
  13. property real pace: 1
  14. property bool smoothedEffects: false
  15. property bool viewItemCount: false
  16. property bool globalWorld: false
  17. // Very computationally heavy: 40% vs 20% for 0.1 vs 0
  18. property real restitution: 0
  19. property string effect: ""
  20. }
  21. Rectangle {
  22. focus: true
  23. color: "black"
  24. anchors.fill: parent
  25. Keys.forwardTo: [punk, toplevelhandler]
  26. Gravity {
  27. // TODO: generalize all this
  28. id: punk
  29. }
  30. }
  31. Rectangle {
  32. id: toplevelhandler
  33. focus: true
  34. Keys.onLeftPressed: settings.columnCount = Math.max(settings.columnCount-1,1)
  35. Keys.onRightPressed: settings.columnCount++
  36. }
  37. Rectangle {
  38. visible: imageModel.rowCount() === 0
  39. function checkModel() {
  40. visible = (imageModel.rowCount() === 0)
  41. }
  42. color: "red"
  43. width: childrenRect.width
  44. height: childrenRect.height
  45. anchors { bottom: parent.bottom; horizontalCenter: parent.horizontalCenter }
  46. Text {
  47. font.pointSize: 40
  48. text: "No images found/provided"
  49. }
  50. Component.onCompleted: modelRelay.countChanged.connect(checkModel);
  51. }
  52. Component.onCompleted: showFullScreen()
  53. }