Qt 6.11 is out! See what's new in the release
blog
[Solved] Dynamically resized rectangle
QML and Qt Quick
3
Posts
2
Posters
2.8k
Views
1
Watching
-
Hi,
Please, could somebody get me little help or hint ?
I need to have few rectangles (as Delegates to ListView) which are capable to change height according to lenght of text inside of it and width of whole window (width of ListView = width of app window - 5, or something like that :)Is this possible?
Thanks! -
You can do something like that
@
Component {
id: listDelegate
Item {
id: listDelegateWrapper
height: textElement.height
width: listView.width
Text {
id: textElement
height: paintedHeight
}
}
}
@ -
Yes, thanks a lot! It works now.