RangeSliderSpecifics.qml 4.9 KB

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