use the resize event
svn path=/trunk/KDE/kdelibs/; revision=1017755
This commit is contained in:
parent
a36b7045f9
commit
b4fa1b3859
@ -163,6 +163,11 @@ bool ItemBackground::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
|
||||
return false;
|
||||
}
|
||||
|
||||
void ItemBackground::resizeEvent(QGraphicsSceneResizeEvent *)
|
||||
{
|
||||
d->frameSvg->resizeFrame(size());
|
||||
}
|
||||
|
||||
QVariant ItemBackground::itemChange(GraphicsItemChange change, const QVariant &value)
|
||||
{
|
||||
if (d->immediate) {
|
||||
@ -193,10 +198,6 @@ void ItemBackground::paint(QPainter *painter, const QStyleOptionGraphicsItem *op
|
||||
{
|
||||
Q_UNUSED(widget)
|
||||
|
||||
if (d->frameSvg->frameSize() != option->rect.size()) {
|
||||
d->frameSvg->resizeFrame(option->rect.size());
|
||||
}
|
||||
|
||||
if (qFuzzyCompare(d->opacity, (qreal)1.0)) {
|
||||
d->frameSvg->paintFrame(painter, option->rect.topLeft());
|
||||
} else if (qFuzzyCompare(d->opacity+1, (qreal)1.0)) {
|
||||
|
@ -72,6 +72,11 @@ protected:
|
||||
*/
|
||||
bool sceneEventFilter(QGraphicsItem *watched, QEvent *event);
|
||||
|
||||
/**
|
||||
* @reimp from QGraphicsItem
|
||||
*/
|
||||
void resizeEvent(QGraphicsSceneResizeEvent *);
|
||||
|
||||
private:
|
||||
Q_PRIVATE_SLOT(d, void animationUpdate(qreal progress))
|
||||
Q_PRIVATE_SLOT(d, void targetDestroyed(QObject*))
|
||||
|
Loading…
Reference in New Issue
Block a user