ComboBoxSpecifics.qml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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("ComboBox")
  12. SectionLayout {
  13. Label {
  14. text: qsTr("Text Role")
  15. tooltip: qsTr("The model role used for displaying text.")
  16. }
  17. SecondColumnLayout {
  18. LineEdit {
  19. backendValue: backendValues.textRole
  20. Layout.fillWidth: true
  21. }
  22. }
  23. Label {
  24. text: qsTr("Current")
  25. tooltip: qsTr("The index of the current item.")
  26. }
  27. SecondColumnLayout {
  28. SpinBox {
  29. maximumValue: 9999999
  30. minimumValue: -9999999
  31. decimals: 0
  32. backendValue: backendValues.currentIndex
  33. Layout.fillWidth: true
  34. }
  35. }
  36. Label {
  37. text: qsTr("Editable")
  38. tooltip: qsTr("Whether the combo box is editable.")
  39. }
  40. SecondColumnLayout {
  41. CheckBox {
  42. text: backendValues.editable.valueToString
  43. backendValue: backendValues.editable
  44. Layout.fillWidth: true
  45. }
  46. }
  47. Label {
  48. text: qsTr("Flat")
  49. tooltip: qsTr("Whether the combo box button is flat.")
  50. }
  51. SecondColumnLayout {
  52. CheckBox {
  53. text: backendValues.flat.valueToString
  54. backendValue: backendValues.flat
  55. Layout.fillWidth: true
  56. }
  57. }
  58. Label {
  59. text: qsTr("DisplayText")
  60. tooltip: qsTr("Holds the text that is displayed on the combo box button.")
  61. }
  62. SecondColumnLayout {
  63. LineEdit {
  64. backendValue: backendValues.displayText
  65. Layout.fillWidth: true
  66. }
  67. }
  68. }
  69. }
  70. ControlSection {
  71. width: parent.width
  72. }
  73. FontSection {
  74. width: parent.width
  75. }
  76. PaddingSection {
  77. width: parent.width
  78. }
  79. }