main.qml 2.7 KB

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