add a sensible size hint
svn path=/trunk/KDE/kdelibs/; revision=1005675
This commit is contained in:
parent
02e6870f4e
commit
c6bab8100d
@ -96,6 +96,15 @@ 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();
|
||||
} else {
|
||||
return QGraphicsWidget::sizeHint(which, constraint);
|
||||
}
|
||||
}
|
||||
|
||||
} // Plasma namespace
|
||||
|
||||
#include "svgwidget.moc"
|
||||
|
@ -58,6 +58,7 @@ class PLASMA_EXPORT SvgWidget : public QGraphicsWidget
|
||||
|
||||
protected:
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint) const;
|
||||
|
||||
private:
|
||||
SvgWidgetPrivate * const d;
|
||||
|
Loading…
Reference in New Issue
Block a user