Button.qml 353 B

123456789101112131415161718192021
  1. import QtQuick 1.0
  2. Image {
  3. id: button
  4. property string sourceImage
  5. signal clicked
  6. width: 60
  7. height: 60
  8. source: mouseArea.pressed ? "gfx/"+sourceImage+"_down.png" : "gfx/"+sourceImage+"_up.png"
  9. MouseArea {
  10. id: mouseArea
  11. anchors.fill: parent
  12. onClicked: button.clicked()
  13. }
  14. }