T_Tooltip.qml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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:"Tooltip"
  9. leftPadding:10
  10. rightPadding:10
  11. bottomPadding:20
  12. spacing: 0
  13. FluText{
  14. Layout.topMargin: 20
  15. text:"鼠标悬停不动,弹出Tooltip"
  16. }
  17. FluArea{
  18. Layout.fillWidth: true
  19. Layout.topMargin: 20
  20. height: 68
  21. paddings: 10
  22. Column{
  23. spacing: 5
  24. anchors{
  25. verticalCenter: parent.verticalCenter
  26. left: parent.left
  27. }
  28. FluText{
  29. text:"FluIconButton的text属性自带Tooltip效果"
  30. }
  31. FluIconButton{
  32. iconSource:FluentIcons.ChromeCloseContrast
  33. iconSize: 15
  34. text:"删除"
  35. onClicked:{
  36. showSuccess("点击IconButton")
  37. }
  38. }
  39. }
  40. }
  41. CodeExpander{
  42. Layout.fillWidth: true
  43. Layout.topMargin: -1
  44. code:'FluIconButton{
  45. iconSource:FluentIcons.ChromeCloseContrast
  46. iconSize: 15
  47. text:"删除"
  48. onClicked:{
  49. showSuccess("点击IconButton")
  50. }
  51. }
  52. '
  53. }
  54. FluArea{
  55. Layout.fillWidth: true
  56. Layout.topMargin: 20
  57. height: 68
  58. paddings: 10
  59. Column{
  60. spacing: 5
  61. anchors{
  62. verticalCenter: parent.verticalCenter
  63. left: parent.left
  64. }
  65. FluText{
  66. text:"给一个Button添加Tooltip效果"
  67. }
  68. FluButton{
  69. id:button_1
  70. text:"删除"
  71. onClicked:{
  72. showSuccess("点击一个Button")
  73. }
  74. FluTooltip{
  75. visible: button_1.hovered
  76. text:button_1.text
  77. delay: 1000
  78. }
  79. }
  80. }
  81. }
  82. CodeExpander{
  83. Layout.fillWidth: true
  84. Layout.topMargin: -1
  85. code:'FluButton{
  86. id:button_1
  87. text:"删除"
  88. FluTooltip{
  89. visible: button_1.hovered
  90. text:button_1.text
  91. delay: 1000
  92. }
  93. onClicked:{
  94. showSuccess("点击一个Button")
  95. }
  96. }'
  97. }
  98. }