main.qml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. import QtQuick 2.6
  2. import QtQuick.Window 2.2
  3. import QtQuick.Controls 1.5
  4. import QtQuick.Controls.Styles 1.4
  5. import QtQuick.Controls.Private 1.0
  6. import com.gfa.ipc.appctrl 1.0
  7. Window {
  8. visible: true
  9. width: 800
  10. height: 480
  11. Component {
  12. id: imageDelegate
  13. Item {
  14. Image {
  15. anchors.centerIn: parent
  16. fillMode: Image.PreserveAspectFit
  17. height:20
  18. source: (styleData.value) === "usb" ? "qrc:/img/usb64.png" : (((styleData.value) === "ata" || (styleData.value) === "int") ? "qrc:/img/ata64.png" : "qrc:/img/mmc64.png")
  19. }
  20. }
  21. }
  22. Component {
  23. id: idTreeItemStyle
  24. Text {
  25. font.pointSize: 8
  26. font.italic: styleData.column ? false : true
  27. verticalAlignment: Text.AlignVCenter
  28. elide: styleData.elideMode
  29. color: styleData.textColor
  30. text: styleData.value
  31. }
  32. }
  33. Component {
  34. id: idButtonStyle
  35. ButtonStyle {
  36. label: Text {
  37. renderType: Text.NativeRendering
  38. verticalAlignment: Text.AlignVCenter
  39. horizontalAlignment: Text.AlignHCenter
  40. font.pointSize: 8
  41. text: StyleHelpers.stylizeMnemonics(control.text)
  42. color: SystemPaletteSingleton.buttonText(control.enabled)
  43. }
  44. }
  45. }
  46. Component {
  47. id: idTableViewHeaderStyle
  48. BorderImage {
  49. height: Math.round(textItem.implicitHeight * 1.2)
  50. source: "qrc:/img/header.png"
  51. border.left: 4
  52. border.bottom: 2
  53. border.top: 2
  54. Text {
  55. id: textItem
  56. anchors.fill: parent
  57. verticalAlignment: Text.AlignVCenter
  58. horizontalAlignment: styleData.textAlignment
  59. anchors.leftMargin: horizontalAlignment === Text.AlignLeft ? 12 : 1
  60. anchors.rightMargin: horizontalAlignment === Text.AlignRight ? 8 : 1
  61. font.pointSize: 8
  62. font.bold: true
  63. text: styleData.value
  64. elide: Text.ElideRight
  65. color: styleData.textColor ? styleData.textColor : "black"
  66. renderType: Text.NativeRendering
  67. }
  68. Rectangle {
  69. width: 1
  70. height: parent.height - 2
  71. y: 1
  72. color: "#ccc"
  73. }
  74. }
  75. }
  76. Component {
  77. id: idTableViewItemStyle
  78. Item {
  79. height: Math.max(16, label.implicitHeight)
  80. property int implicitWidth: label.implicitWidth + 20
  81. Text {
  82. id: label
  83. objectName: "label"
  84. width: parent.width - x - (horizontalAlignment === Text.AlignRight ? 8 : 1)
  85. x: (styleData.hasOwnProperty("depth") && styleData.column === 0) ? 0 :
  86. horizontalAlignment === Text.AlignRight ? 1 : 8
  87. horizontalAlignment: styleData.textAlignment
  88. anchors.verticalCenter: parent.verticalCenter
  89. anchors.verticalCenterOffset: 1
  90. elide: styleData.elideMode
  91. font.pointSize: 8
  92. text: styleData.value !== undefined ? styleData.value.toString() : ""
  93. color: styleData.textColor
  94. renderType: Text.NativeRendering
  95. }
  96. }
  97. }
  98. Loader {
  99. id: idPageLoader
  100. source: "appctrl.qml"
  101. }
  102. }