The previous "hover effect on drag" patch was buggy. Now we are using sceneEventFilter and it seems better.
svn path=/trunk/KDE/kdelibs/; revision=948792
This commit is contained in:
parent
1b49180a0c
commit
2f0da61660
@ -1186,23 +1186,17 @@ void IconWidget::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||
QGraphicsWidget::hoverLeaveEvent(event);
|
||||
}
|
||||
|
||||
|
||||
void IconWidget::dragEnterEvent(QGraphicsSceneDragDropEvent * event)
|
||||
bool IconWidget::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
|
||||
{
|
||||
event->ignore();
|
||||
if (event->type() == QEvent::GraphicsSceneDragEnter){
|
||||
d->hoverEffect(true);
|
||||
update();
|
||||
|
||||
QGraphicsWidget::dragEnterEvent(event);
|
||||
}
|
||||
|
||||
void IconWidget::dragLeaveEvent(QGraphicsSceneDragDropEvent * event)
|
||||
{
|
||||
// d->states &= ~IconWidgetPrivate::HoverState; // Will be set once progress is zero again ...
|
||||
}else if (event->type() == QEvent::GraphicsSceneDragLeave){
|
||||
d->hoverEffect(false);
|
||||
update();
|
||||
}
|
||||
|
||||
QGraphicsWidget::dragLeaveEvent(event);
|
||||
return false;
|
||||
}
|
||||
|
||||
void IconWidget::setPressed(bool pressed)
|
||||
|
@ -283,8 +283,7 @@ protected:
|
||||
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
|
||||
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
|
||||
|
||||
void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
|
||||
void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
|
||||
bool sceneEventFilter(QGraphicsItem *watched, QEvent *event);
|
||||
|
||||
public:
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user