Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

[SOLVED]How to limit the text width with the restriction of parent width

$
0
0
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.”

Viewing all articles
Browse latest Browse all 4972

Trending Articles