AbstractButtonSection.qml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. // Copyright (C) 2017 The Qt Company Ltd.
  2. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
  3. // Qt-Security score:significant reason:default
  4. import QtQuick
  5. import HelperWidgets
  6. import QtQuick.Layouts
  7. Section {
  8. caption: qsTr("AbstractButton")
  9. SectionLayout {
  10. Label {
  11. text: qsTr("Text")
  12. tooltip: qsTr("The text displayed on the button.")
  13. }
  14. SecondColumnLayout {
  15. LineEdit {
  16. backendValue: backendValues.text
  17. Layout.fillWidth: true
  18. }
  19. }
  20. Label {
  21. text: qsTr("Display")
  22. tooltip: qsTr("Determines how the icon and text are displayed within the button.")
  23. disabledState: !backendValues.display.isAvailable
  24. }
  25. SecondColumnLayout {
  26. ComboBox {
  27. backendValue: backendValues.display
  28. model: [ "IconOnly", "TextOnly", "TextBesideIcon" ]
  29. scope: "AbstractButton"
  30. Layout.fillWidth: true
  31. enabled: backendValue.isAvailable
  32. }
  33. }
  34. Label {
  35. visible: checkable
  36. text: qsTr("Checkable")
  37. tooltip: qsTr("Whether the button is checkable.")
  38. }
  39. SecondColumnLayout {
  40. CheckBox {
  41. text: backendValues.checkable.valueToString
  42. backendValue: backendValues.checkable
  43. Layout.fillWidth: true
  44. }
  45. }
  46. Label {
  47. text: qsTr("Checked")
  48. tooltip: qsTr("Whether the button is checked.")
  49. }
  50. SecondColumnLayout {
  51. CheckBox {
  52. text: backendValues.checked.valueToString
  53. backendValue: backendValues.checked
  54. Layout.fillWidth: true
  55. }
  56. }
  57. Label {
  58. text: qsTr("Exclusive")
  59. tooltip: qsTr("Whether the button is exclusive.")
  60. disabledState: !backendValues.autoExclusive.isAvailable
  61. }
  62. SecondColumnLayout {
  63. CheckBox {
  64. text: backendValues.autoExclusive.valueToString
  65. backendValue: backendValues.autoExclusive
  66. Layout.fillWidth: true
  67. enabled: backendValue.isAvailable
  68. }
  69. }
  70. Label {
  71. text: qsTr("Auto-Repeat")
  72. tooltip: qsTr("Whether the button repeats pressed(), released() and clicked() signals while the button is pressed and held down.")
  73. }
  74. SecondColumnLayout {
  75. CheckBox {
  76. text: backendValues.autoRepeat.valueToString
  77. backendValue: backendValues.autoRepeat
  78. Layout.fillWidth: true
  79. }
  80. }
  81. }
  82. }