set containsmultipleimages when an id is set

better size hint

svn path=/trunk/KDE/kdelibs/; revision=1005679
This commit is contained in:
Marco Martin 2009-08-01 18:48:09 +00:00
parent c6bab8100d
commit bb659e280c

View File

@ -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) {
if (d->elementID.isNull()) {
return d->svg->size();
} else {
return d->svg->elementSize(d->elementID);
}
} else {
return QGraphicsWidget::sizeHint(which, constraint);
}