set containsmultipleimages when an id is set
better size hint svn path=/trunk/KDE/kdelibs/; revision=1005679
This commit is contained in:
parent
c6bab8100d
commit
bb659e280c
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user