view.qml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // Copyright (C) 2021 The Qt Company Ltd.
  2. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
  3. import QtQuick 2.12
  4. import QtQuick.Controls 2.12
  5. Page {
  6. width: 640
  7. height: 480
  8. required property var myModel
  9. header: Label {
  10. color: "#15af15"
  11. text: qsTr("Where do people use Qt?")
  12. font.pointSize: 17
  13. font.bold: true
  14. font.family: "Arial"
  15. renderType: Text.NativeRendering
  16. horizontalAlignment: Text.AlignHCenter
  17. padding: 10
  18. }
  19. Rectangle {
  20. id: root
  21. width: parent.width
  22. height: parent.height
  23. Image {
  24. id: image
  25. fillMode: Image.PreserveAspectFit
  26. anchors.centerIn: root
  27. source: "./logo.png"
  28. opacity: 0.5
  29. }
  30. ListView {
  31. id: view
  32. anchors.fill: root
  33. anchors.margins: 25
  34. model: myModel
  35. delegate: Text {
  36. anchors.leftMargin: 50
  37. font.pointSize: 15
  38. horizontalAlignment: Text.AlignHCenter
  39. text: display
  40. }
  41. }
  42. }
  43. NumberAnimation {
  44. id: anim
  45. running: true
  46. target: view
  47. property: "contentY"
  48. duration: 500
  49. }
  50. }