return a size hint based on font metrics
svn path=/trunk/KDE/kdelibs/; revision=1046144
This commit is contained in:
parent
4f6ff5ef68
commit
a5f39f0f06
@ -212,6 +212,15 @@ void FlashingLabel::paint(QPainter *painter, const QStyleOptionGraphicsItem *opt
|
||||
}
|
||||
}
|
||||
|
||||
QSizeF FlashingLabel::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const
|
||||
{
|
||||
if (which == Qt::PreferredSize) {
|
||||
QFontMetrics fm(d->font);
|
||||
return fm.boundingRect(d->text).size();
|
||||
}
|
||||
return QGraphicsWidget::sizeHint(which, constraint);
|
||||
}
|
||||
|
||||
void FlashingLabelPrivate::renderPixmap(const QSize &size)
|
||||
{
|
||||
if (renderedPixmap.size() != size) {
|
||||
|
@ -57,6 +57,9 @@ class PLASMA_EXPORT FlashingLabel : public QGraphicsWidget
|
||||
void setAutohide(bool autohide);
|
||||
bool autohide() const;
|
||||
|
||||
protected:
|
||||
QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const;
|
||||
|
||||
public Q_SLOTS:
|
||||
void kill();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user