From bb659e280c2bc90587f79e38dfd5e54c5dec504b Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Sat, 1 Aug 2009 18:48:09 +0000 Subject: [PATCH] set containsmultipleimages when an id is set better size hint svn path=/trunk/KDE/kdelibs/; revision=1005679 --- widgets/svgwidget.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/widgets/svgwidget.cpp b/widgets/svgwidget.cpp index 0324db459..7e936d792 100644 --- a/widgets/svgwidget.cpp +++ b/widgets/svgwidget.cpp @@ -77,6 +77,7 @@ Svg *SvgWidget::svg() const void SvgWidget::setElementID(const QString &elementID) { + d->svg->setContainsMultipleImages(!elementID.isNull()); d->elementID = elementID; update(); } @@ -99,7 +100,11 @@ void SvgWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QSizeF SvgWidget::sizeHint(Qt::SizeHint which, const QSizeF & constraint) const { if (d->svg && which == Qt::PreferredSize) { - return d->svg->size(); + if (d->elementID.isNull()) { + return d->svg->size(); + } else { + return d->svg->elementSize(d->elementID); + } } else { return QGraphicsWidget::sizeHint(which, constraint); }