diff options
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativeimage.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativeimage.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeimage.cpp b/src/declarative/graphicsitems/qdeclarativeimage.cpp index e4f3464..ca86637 100644 --- a/src/declarative/graphicsitems/qdeclarativeimage.cpp +++ b/src/declarative/graphicsitems/qdeclarativeimage.cpp @@ -311,6 +311,12 @@ void QDeclarativeImage::updatePaintedGeometry() d->paintedWidth = heightScale * qreal(d->pix.width()); d->paintedHeight = height(); } + if (widthValid() && !heightValid()) { + setImplicitHeight(d->paintedHeight); + } + if (heightValid() && !widthValid()) { + setImplicitWidth(d->paintedWidth); + } } else { d->paintedWidth = width(); d->paintedHeight = height(); |