SliderSpecifics.qml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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. Column {
  8. width: parent.width
  9. Section {
  10. width: parent.width
  11. caption: qsTr("Slider")
  12. SectionLayout {
  13. Label {
  14. text: qsTr("Value")
  15. tooltip: qsTr("The current value of the slider.")
  16. }
  17. SecondColumnLayout {
  18. SpinBox {
  19. minimumValue: Math.min(backendValues.from.value, backendValues.to.value)
  20. maximumValue: Math.max(backendValues.from.value, backendValues.to.value)
  21. decimals: 2
  22. stepSize: 0.1
  23. backendValue: backendValues.value
  24. Layout.fillWidth: true
  25. }
  26. }
  27. Label {
  28. text: qsTr("From")
  29. tooltip: qsTr("The starting value of the slider range.")
  30. }
  31. SecondColumnLayout {
  32. SpinBox {
  33. maximumValue: 9999999
  34. minimumValue: -9999999
  35. decimals: 2
  36. stepSize: 0.1
  37. backendValue: backendValues.from
  38. Layout.fillWidth: true
  39. }
  40. }
  41. Label {
  42. text: qsTr("To")
  43. tooltip: qsTr("The ending value of the slider range.")
  44. }
  45. SecondColumnLayout {
  46. SpinBox {
  47. maximumValue: 9999999
  48. minimumValue: -9999999
  49. decimals: 2
  50. stepSize: 0.1
  51. backendValue: backendValues.to
  52. Layout.fillWidth: true
  53. }
  54. }
  55. Label {
  56. text: qsTr("Step Size")
  57. tooltip: qsTr("The step size of the slider.")
  58. }
  59. SecondColumnLayout {
  60. SpinBox {
  61. maximumValue: 9999999
  62. minimumValue: -9999999
  63. decimals: 2
  64. stepSize: 0.1
  65. backendValue: backendValues.stepSize
  66. Layout.fillWidth: true
  67. }
  68. }
  69. Label {
  70. text: qsTr("Snap Mode")
  71. tooltip: qsTr("The snap mode of the slider.")
  72. disabledState: !backendValues.snapMode.isAvailable
  73. }
  74. SecondColumnLayout {
  75. ComboBox {
  76. backendValue: backendValues.snapMode
  77. model: [ "NoSnap", "SnapOnRelease", "SnapAlways" ]
  78. scope: "Slider"
  79. Layout.fillWidth: true
  80. enabled: backendValue.isAvailable
  81. }
  82. }
  83. Label {
  84. text: qsTr("Orientation")
  85. tooltip: qsTr("The orientation of the slider.")
  86. }
  87. SecondColumnLayout {
  88. ComboBox {
  89. backendValue: backendValues.orientation
  90. model: [ "Horizontal", "Vertical" ]
  91. scope: "Qt"
  92. Layout.fillWidth: true
  93. }
  94. }
  95. Label {
  96. text: qsTr("Live")
  97. tooltip: qsTr("Whether the slider provides live value updates.")
  98. disabledState: !backendValues.live.isAvailable
  99. }
  100. SecondColumnLayout {
  101. CheckBox {
  102. text: backendValues.live.valueToString
  103. backendValue: backendValues.live
  104. Layout.fillWidth: true
  105. enabled: backendValue.isAvailable
  106. }
  107. }
  108. Label {
  109. text: qsTr("Touch drag threshold")
  110. tooltip: qsTr("The threshold (in logical pixels) at which a touch drag event will be initiated.")
  111. disabledState: !backendValues.touchDragThreshold.isAvailable
  112. }
  113. SecondColumnLayout {
  114. SpinBox {
  115. minimumValue: 0
  116. maximumValue: 10000
  117. decimals: 0
  118. backendValue: backendValues.touchDragThreshold
  119. Layout.fillWidth: true
  120. enabled: backendValue.isAvailable
  121. }
  122. }
  123. }
  124. }
  125. ControlSection {
  126. width: parent.width
  127. }
  128. FontSection {
  129. width: parent.width
  130. }
  131. PaddingSection {
  132. width: parent.width
  133. }
  134. }