T_FlipView.qml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. import QtQuick
  2. import QtQuick.Controls
  3. import QtQuick.Layouts
  4. import QtQuick.Window
  5. import FluentUI
  6. import "../component"
  7. FluScrollablePage{
  8. title:"FlipView"
  9. leftPadding:10
  10. rightPadding:10
  11. bottomPadding:20
  12. spacing: 0
  13. FluArea{
  14. Layout.fillWidth: true
  15. height: 340
  16. paddings: 10
  17. Layout.topMargin: 20
  18. ColumnLayout{
  19. anchors.verticalCenter: parent.verticalCenter
  20. FluText{
  21. text:"水平方向的FlipView"
  22. }
  23. FluFlipView{
  24. Image{
  25. source: "qrc:/example/res/image/banner_1.jpg"
  26. asynchronous: true
  27. fillMode:Image.PreserveAspectCrop
  28. }
  29. Image{
  30. source: "qrc:/example/res/image/banner_2.jpg"
  31. asynchronous: true
  32. fillMode:Image.PreserveAspectCrop
  33. }
  34. Image{
  35. source: "qrc:/example/res/image/banner_3.jpg"
  36. asynchronous: true
  37. fillMode:Image.PreserveAspectCrop
  38. }
  39. }
  40. }
  41. }
  42. CodeExpander{
  43. Layout.fillWidth: true
  44. Layout.topMargin: -1
  45. code:'FluFlipView{
  46. Image{
  47. source: "qrc:/example/res/image/banner_1.jpg"
  48. asynchronous: true
  49. fillMode:Image.PreserveAspectCrop
  50. }
  51. Image{
  52. source: "qrc:/example/res/image/banner_1.jpg"
  53. asynchronous: true
  54. fillMode:Image.PreserveAspectCrop
  55. }
  56. Image{
  57. source: "qrc:/example/res/image/banner_1.jpg"
  58. asynchronous: true
  59. fillMode:Image.PreserveAspectCrop
  60. }
  61. }
  62. '
  63. }
  64. FluArea{
  65. Layout.fillWidth: true
  66. height: 340
  67. paddings: 10
  68. Layout.topMargin: 20
  69. ColumnLayout{
  70. anchors.verticalCenter: parent.verticalCenter
  71. FluText{
  72. text:"垂直方向的FlipView"
  73. }
  74. FluFlipView{
  75. vertical:true
  76. Image{
  77. source: "qrc:/example/res/image/banner_1.jpg"
  78. asynchronous: true
  79. sourceSize: Qt.size(400,300)
  80. fillMode:Image.PreserveAspectCrop
  81. }
  82. Image{
  83. source: "qrc:/example/res/image/banner_2.jpg"
  84. asynchronous: true
  85. fillMode:Image.PreserveAspectCrop
  86. }
  87. Image{
  88. source: "qrc:/example/res/image/banner_3.jpg"
  89. asynchronous: true
  90. fillMode:Image.PreserveAspectCrop
  91. }
  92. }
  93. }
  94. }
  95. CodeExpander{
  96. Layout.fillWidth: true
  97. Layout.topMargin: -1
  98. code:'FluFlipView{
  99. vertical:true
  100. Image{
  101. source: "qrc:/example/res/image/banner_1.jpg"
  102. asynchronous: true
  103. fillMode:Image.PreserveAspectCrop
  104. }
  105. Image{
  106. source: "qrc:/example/res/image/banner_1.jpg"
  107. asynchronous: true
  108. fillMode:Image.PreserveAspectCrop
  109. }
  110. Image{
  111. source: "qrc:/example/res/image/banner_1.jpg"
  112. asynchronous: true
  113. fillMode:Image.PreserveAspectCrop
  114. }
  115. }
  116. '
  117. }
  118. }