Button.qml 834 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import QtQuick 2.0
  2. Item {
  3. id: root
  4. property alias text: textItem.text
  5. signal clicked
  6. width: 320
  7. height: 64
  8. Rectangle {
  9. anchors.fill: parent
  10. border.color: "#000000"
  11. border.width: 2
  12. color: mouseArea.pressed && mouseArea.containsMouse ? "#ffffff" : "#d0d0d0"
  13. }
  14. Image {
  15. anchors.verticalCenter: parent.verticalCenter
  16. anchors.right: parent.right
  17. anchors.rightMargin: 8
  18. source: "images/back.png"
  19. rotation: 180
  20. width: 48
  21. height: 48
  22. }
  23. Text {
  24. id: textItem
  25. color: "#000000"
  26. font.pixelSize: 16
  27. anchors.centerIn: parent
  28. anchors.horizontalCenterOffset: -24
  29. }
  30. MouseArea {
  31. id: mouseArea
  32. anchors.fill: parent
  33. onClicked: root.clicked();
  34. }
  35. }