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
i did not use state, but i use the idea of dummy text to have width. thanks
my code :
Rectangle{
id:messageBoxCadre
width: (modelData.messageLength>25)? (wrapper.width - 20): messageBox.width+10
height: messageBox.height+5
color: modelData.myMessage ? "#aa84b2":"#380c47"
radius: 10
Text {
id:messageBox
width: (modelData.messageLength>25)? (wrapper.width - 20): dummy_text.dummy_text
text: ''+modelData.message+' '
wrapMode: "WordWrap"
}
Text {
id: dummy_text
text: ''+modelData.message+' '
visible: false
}
}