ControlSection.qml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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("Control")
  9. SectionLayout {
  10. Label {
  11. text: qsTr("Enabled")
  12. tooltip: qsTr("Whether the control is enabled.")
  13. }
  14. SecondColumnLayout {
  15. CheckBox {
  16. text: backendValues.enabled.valueToString
  17. backendValue: backendValues.enabled
  18. Layout.fillWidth: true
  19. }
  20. }
  21. Label {
  22. text: qsTr("Focus Policy")
  23. tooltip: qsTr("Focus policy of the control.")
  24. disabledState: !backendValues.focusPolicy.isAvailable
  25. }
  26. SecondColumnLayout {
  27. ComboBox {
  28. backendValue: backendValues.focusPolicy
  29. model: [ "TabFocus", "ClickFocus", "StrongFocus", "WheelFocus", "NoFocus" ]
  30. scope: "Qt"
  31. Layout.fillWidth: true
  32. enabled: backendValue.isAvailable
  33. }
  34. }
  35. Label {
  36. text: qsTr("Hover")
  37. tooltip: qsTr("Whether control accepts hover events.")
  38. disabledState: !backendValues.hoverEnabled.isAvailable
  39. }
  40. SecondColumnLayout {
  41. CheckBox {
  42. text: backendValues.hoverEnabled.valueToString
  43. backendValue: backendValues.hoverEnabled
  44. Layout.fillWidth: true
  45. enabled: backendValue.isAvailable
  46. }
  47. }
  48. Label {
  49. text: qsTr("Spacing")
  50. tooltip: qsTr("Spacing between internal elements of the control.")
  51. }
  52. SecondColumnLayout {
  53. SpinBox {
  54. maximumValue: 9999999
  55. minimumValue: -9999999
  56. decimals: 0
  57. backendValue: backendValues.spacing
  58. Layout.fillWidth: true
  59. }
  60. }
  61. Label {
  62. text: qsTr("Wheel")
  63. tooltip: qsTr("Whether control accepts wheel events.")
  64. disabledState: !backendValues.wheelEnabled.isAvailable
  65. }
  66. SecondColumnLayout {
  67. CheckBox {
  68. text: backendValues.wheelEnabled.valueToString
  69. backendValue: backendValues.wheelEnabled
  70. Layout.fillWidth: true
  71. enabled: backendValue.isAvailable
  72. }
  73. }
  74. }
  75. }