File: Button.qml

package info (click to toggle)
qtmir 0.8.0~git20230223.bd21224-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,568 kB
  • sloc: cpp: 22,847; python: 304; xml: 271; ansic: 87; makefile: 20; sh: 12
file content (26 lines) | stat: -rw-r--r-- 464 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import QtQuick 2.0

Rectangle {
    id: root

    signal clicked

    property alias text: text.text

    implicitHeight: 40
    implicitWidth: 150

    color: (mouseArea.pressed) ? "red" : "lightblue"

    MouseArea {
        id: mouseArea
        anchors.fill: parent
        onClicked: { root.clicked(); }
    }

    Text {
        id: text
        anchors.verticalCenter: parent.verticalCenter
        anchors.horizontalCenter: parent.horizontalCenter
    }
}