try to be more strict when the policy is fixed:
the minimum and the preferred size are the same (i.e. avoid to cut away text, always) svn path=/trunk/KDE/kdelibs/; revision=1125673
This commit is contained in:
parent
fe9e96f8bf
commit
4ab87220a3
@ -363,6 +363,15 @@ QVariant Label::itemChange(GraphicsItemChange change, const QVariant & value)
|
||||
return QGraphicsWidget::itemChange(change, value);
|
||||
}
|
||||
|
||||
QSizeF Label::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const
|
||||
{
|
||||
if (sizePolicy().verticalPolicy() == QSizePolicy::Fixed) {
|
||||
return QGraphicsProxyWidget::sizeHint(Qt::PreferredSize, constraint);
|
||||
} else {
|
||||
return QGraphicsProxyWidget::sizeHint(which, constraint);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace Plasma
|
||||
|
||||
#include <label.moc>
|
||||
|
@ -171,6 +171,7 @@ protected:
|
||||
bool event(QEvent *event);
|
||||
QVariant itemChange(GraphicsItemChange change, const QVariant & value);
|
||||
void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
|
||||
QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const;
|
||||
|
||||
private:
|
||||
Q_PRIVATE_SLOT(d, void setPalette())
|
||||
|
Loading…
Reference in New Issue
Block a user