SpinBoxSpecifics.qml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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("SpinBox")
  12. SectionLayout {
  13. Label {
  14. text: qsTr("Value")
  15. tooltip: qsTr("The current value of the spinbox.")
  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. backendValue: backendValues.value
  23. Layout.fillWidth: true
  24. }
  25. }
  26. Label {
  27. text: qsTr("From")
  28. tooltip: qsTr("The starting value of the spinbox range.")
  29. }
  30. SecondColumnLayout {
  31. SpinBox {
  32. maximumValue: 9999999
  33. minimumValue: -9999999
  34. decimals: 2
  35. backendValue: backendValues.from
  36. Layout.fillWidth: true
  37. }
  38. }
  39. Label {
  40. text: qsTr("To")
  41. tooltip: qsTr("The ending value of the spinbox range.")
  42. }
  43. SecondColumnLayout {
  44. SpinBox {
  45. maximumValue: 9999999
  46. minimumValue: -9999999
  47. decimals: 2
  48. backendValue: backendValues.to
  49. Layout.fillWidth: true
  50. }
  51. }
  52. Label {
  53. text: qsTr("Step Size")
  54. tooltip: qsTr("The step size of the spinbox.")
  55. }
  56. SecondColumnLayout {
  57. SpinBox {
  58. maximumValue: 9999999
  59. minimumValue: -9999999
  60. decimals: 2
  61. backendValue: backendValues.stepSize
  62. Layout.fillWidth: true
  63. }
  64. }
  65. Label {
  66. text: qsTr("Editable")
  67. tooltip: qsTr("Whether the spinbox is editable.")
  68. }
  69. SecondColumnLayout {
  70. CheckBox {
  71. text: backendValues.editable.valueToString
  72. backendValue: backendValues.editable
  73. Layout.fillWidth: true
  74. }
  75. }
  76. Label {
  77. text: qsTr("Wrap")
  78. tooltip: qsTr("Whether the spinbox wraps.")
  79. }
  80. SecondColumnLayout {
  81. CheckBox {
  82. text: backendValues.wrap.valueToString
  83. backendValue: backendValues.wrap
  84. Layout.fillWidth: true
  85. }
  86. }
  87. }
  88. }
  89. ControlSection {
  90. width: parent.width
  91. }
  92. FontSection {
  93. width: parent.width
  94. }
  95. PaddingSection {
  96. width: parent.width
  97. }
  98. }