T_InfoBar.qml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import QtQuick
  2. import QtQuick.Layouts
  3. import QtQuick.Window
  4. import QtQuick.Controls
  5. import FluentUI
  6. import "../component"
  7. FluScrollablePage{
  8. title:"InfoBar"
  9. leftPadding:10
  10. rightPadding:10
  11. bottomPadding:20
  12. spacing: 0
  13. FluArea{
  14. Layout.fillWidth: true
  15. Layout.topMargin: 20
  16. height: 200
  17. paddings: 10
  18. ColumnLayout{
  19. spacing: 14
  20. anchors{
  21. verticalCenter: parent.verticalCenter
  22. left: parent.left
  23. }
  24. FluButton{
  25. text:"Info"
  26. onClicked: {
  27. showInfo("这是一个Info样式的InfoBar")
  28. }
  29. }
  30. FluButton{
  31. text:"Warning"
  32. onClicked: {
  33. showWarning("这是一个Warning样式的InfoBar")
  34. }
  35. }
  36. FluButton{
  37. text:"Error"
  38. onClicked: {
  39. showError("这是一个Error样式的InfoBar")
  40. }
  41. }
  42. FluButton{
  43. text:"Success"
  44. onClicked: {
  45. showSuccess("这是一个Success样式的InfoBar这是一个Success样式的InfoBar")
  46. }
  47. }
  48. }
  49. }
  50. CodeExpander{
  51. Layout.fillWidth: true
  52. Layout.topMargin: -1
  53. code:'showInfo("这是一个Info样式的InfoBar")
  54. showWarning("这是一个Warning样式的InfoBar")
  55. showError("这是一个Error样式的InfoBar")
  56. showSuccess("这是一个Success样式的InfoBar这是一个Success样式的InfoBar")'
  57. }
  58. }