import QtQuick 2.0 Item { width: 320 height: 480 Text { id: implicitSizedText textFormat: Text.RichText text: "
Implicit size
----- Second line -----
" anchors.centerIn: parent color: "white" Rectangle { anchors.fill: parent z: -1 color: "blue" } } Text { textFormat: Text.RichText text: "
Explicit size
----- Second line -----
" anchors.top: implicitSizedText.bottom anchors.topMargin: 10 anchors.horizontalCenter: parent.horizontalCenter width: 300 color: "white" Rectangle { anchors.fill: parent z: -1 color: "blue" } } }