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

[SOLVED] ListView to show variable width images.

$
0
0
I’m making an application that shows images using ListView and want to change the width of the delegate by the size of each image. code is like the below Component {  id: mydelegate  Item {   id: myitem   width: 70   height: 100   Image {    id: myimage    width: myitem.width; height: myitem.height    fillMode : Image.Stretch    asynchronous: true    source: <some url>    onStatusChanged: {     if( myimage.status === Image.Ready )      if(sourceSize.width > sourceSize.height)       myitem.width = 120;    }   }  } } the result is, the image size varies by the ‘sourceSize’ but the images are overlapped. but after the images that scrolled in are not overlapped. what’s the problem?

Viewing all articles
Browse latest Browse all 4972

Trending Articles