Qml text wrap (max width)

后端 未结 7 1792
抹茶落季
抹茶落季 2021-02-19 02:56

I would like to put text inside a bubble, and I want that my bubble be equal to the text width, but if the text length is too long, I would like the text to wrap automatically a

7条回答
  •  太阳男子
    2021-02-19 03:35

    You can also try something like this, using the dummy text box mentioned above:

    width: Math.min(dummy_text.paintedWidth, 250)
    

    This will use the painted size of the text unless it is greater than your specified pixel width.

提交回复
热议问题