import QtQuick 2.9 import QtQuick.Window 2.2 import QtQuick.Controls 2.4 Window { visible: true width: 640 height: 480 title: qsTr("Hello World") Page { id: app anchors.fill: parent Button { id: onOffBt anchors.centerIn: parent height: parent.height * 0.5 width: height text: "on/off" background: Rectangle { color: onOffBt.pressed ? "lightgrey":"grey" radius: height / 2 } } } }