Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.6.0 Beta1
-
None
-
4c21f7283 (dev), 3924c945d (dev)
Description
In https://codereview.qt-project.org/c/qt/qtdeclarative/+/447861 the test only checks setting a string like "80x60". But for SVG images it's quite normal to set width or height alone:
sourceSize.width: 123
So I think this should be ok for AnimatedImage too.
The reason is to make the image fit into a layout or into a window while allowing it to retain its natural aspect ratio, even if you are switching images, or don't know the original size until you read it. You might want this in a gallery using GridView for example: each delegate wants to be square, but it also wants to have the image fill the height, and avoid distorting it; so maybe you set sourceSize.height and then center it horizontally, and set clip: true on the delegate. (Actually, qtdoc/examples/demos/photosurface/photosurface.qml should probably do this too, to save memory, but in that case any aspect ratio is fine, as long as it's preserved.)
Attachments
Issue Links
- relates to
-
QTBUG-122711 QQuickImageProviderWithOptions::loadSize doesn't deal with options correctly
- Reported
-
QTBUG-17269 Using Image.PreserveAspectFit results in inconsistent implicit/source size
- Reported
- resulted from
-
QTBUG-57501 sourceSize property has different behaviour between Image and AnimatedImage
- Closed
For Gerrit Dashboard: QTBUG-115039 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
547313,18 | QImageReader: allow only one dimension to be used for scaledSize | dev | qt/qtbase | Status: MERGED | +2 | 0 |
547974,5 | QMovie: allow only one dimension to be used for scaledSize | dev | qt/qtbase | Status: MERGED | +2 | 0 |