Search code examples
textalignmentqmlword-wrap

QML - wrapped text right alignment


I want to set the right alignment for the wrapped text. If I set:

wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignRight
text: "text\ntext"

I will get wrapped text but aligned to right "before" wrapping. Sth like:

    text    |
    text    |

instead of

        text|
        text| 

Do I have to set additional params etc.?


Solution

  • Problem solved - we need to use newer QT version (5.2.1 was bugged) or check text width - sth like Measuring text width in Qt