main.qml 1.3 KB

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