import QtQuick 2.1 MouseArea { id: mouseArea height: 200 width: 200 Text { id: text width: implicitWidth // <== !!! anchors.centerIn: parent font.pixelSize: 20 text: mouseArea.pressed ? "fail" : "press\nme..." // NOTE: Also breaks for AlignRight horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter Rectangle { z: -1 anchors.fill: parent border.width: 1 } } }