clip only when animating: some flicker, but clipping always is a bit

slower and seems to lose mouse events when the applet is in a
containment

svn path=/trunk/KDE/kdelibs/; revision=926630
This commit is contained in:
Marco Martin 2009-02-15 21:42:25 +00:00
parent cae61ee4ca
commit 604bd19638

View File

@ -180,6 +180,9 @@ void VideoWidgetPrivate::animateControlWidget(bool show)
newPos = QPoint(0, -controlsWidget->size().height());
}
//clip only when animating
q->setFlags(q->flags()|QGraphicsItem::ItemClipsChildrenToShape);
controlsWidget->setPos(oldPos);
controlsWidget->show();
@ -203,6 +206,8 @@ void VideoWidgetPrivate::slidingCompleted(QGraphicsItem *item)
return;
}
//usually don't clip
q->setFlags(q->flags()^QGraphicsItem::ItemClipsChildrenToShape);
if (controlsWidget->pos().y() < 0) {
controlsWidget->hide();
@ -238,8 +243,6 @@ VideoWidget::VideoWidget(QGraphicsWidget *parent)
setWidget(d->videoWidget);
setAcceptHoverEvents(true);
//FIXME: would be desiderable to have clipping on just when animating, seems that changing it on the fly messes up with visibility of children, indagate if is a qt bug
setFlags(flags()|QGraphicsItem::ItemClipsChildrenToShape);
connect(d->media, SIGNAL(tick(qint64)), this, SIGNAL(tick(qint64)));
connect(d->media, SIGNAL(aboutToFinish()), this, SIGNAL(aboutToFinish()));