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

QML list view change item size to fit text

$
0
0
In wrapper Rectangle set height based on menuEntry height. You might want to center Text inside wrapper, as well set smaller width, specify spacing and etc.         Rectangle         {             id: wrapper             width: menuHolder.width             height: menuEntry.height * 1.5 + 20 // * 1.5 if you are using spacing I believe default is 1.0             state: ListView.isCurrentItem ? "selected" : "notselected"               Text  //TBD keep text inside box             {                 id: menuEntry                 font.pointSize: 20                 width: parent.width                 wrapMode: Text.WordWrap                 text: getDisplayString()                 clip: true             }

Viewing all articles
Browse latest Browse all 4972

Trending Articles