Label {
id: test
width: 100
height: 30
Text{
color: 'red'
width: parent.width // The width of the text is same as parent
anchors.centerIn:parent // The text is placed in center of the parent
elide: Text.AlignRight // Show ellipses '...' if text is not able to fit horizontally
text: qsTr("sometext")
}
}
You should avoid clipping. As per the Performance Considerations And Suggestions document “Clipping is a visual effect, NOT an optimization. It increases (rather than reduces) complexity for the renderer.”
↧