import QtQuick 2.0 import QtQuick.Controls 2.2 Item { property string clickedColor: "#BDBDBD" property string normalColor: "#e0e0e0" property string color: normalColor Rectangle { color: parent.color width: parent.width height: parent.height } MouseArea { width: parent.width height: parent.height onPressed: parent.color = parent.clickedColor onReleased: parent.color = parent.normalColor } }