main.qml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 viewItemCount: false
  15. property bool globalWorld: false
  16. // Very computationally heavy: 40% vs 20% for 0.1 vs 0
  17. property real restitution: 0
  18. property string effect: ""
  19. }
  20. Rectangle {
  21. focus: true
  22. color: "black"
  23. anchors.fill: parent
  24. Keys.forwardTo: [punk, toplevelhandler]
  25. Gravity {
  26. // TODO: generalize all this
  27. id: punk
  28. }
  29. }
  30. Rectangle {
  31. id: toplevelhandler
  32. focus: true
  33. Keys.onLeftPressed: settings.columnCount = Math.max(settings.columnCount-1,1)
  34. Keys.onRightPressed: settings.columnCount++
  35. }
  36. Rectangle {
  37. visible: imageModel.rowCount() === 0
  38. function checkModel() {
  39. visible = (imageModel.rowCount() === 0)
  40. }
  41. color: "red"
  42. width: childrenRect.width
  43. height: childrenRect.height
  44. anchors { bottom: parent.bottom; horizontalCenter: parent.horizontalCenter }
  45. Text {
  46. font.pointSize: 40
  47. text: "No images found/provided"
  48. }
  49. Component.onCompleted: modelRelay.countChanged.connect(checkModel);
  50. }
  51. Component.onCompleted: showFullScreen()
  52. }