Use hover background when something is dragged on the icon.

BUG: 110952

svn path=/trunk/KDE/kdelibs/; revision=948303
This commit is contained in:
Davide Bettio 2009-04-02 18:33:39 +00:00
parent bb5a57bc26
commit 44d2194253
2 changed files with 22 additions and 0 deletions

View File

@ -1186,6 +1186,25 @@ void IconWidget::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
QGraphicsWidget::hoverLeaveEvent(event);
}
void IconWidget::dragEnterEvent(QGraphicsSceneDragDropEvent * event)
{
event->ignore();
d->hoverEffect(true);
update();
QGraphicsWidget::dragEnterEvent(event);
}
void IconWidget::dragLeaveEvent(QGraphicsSceneDragDropEvent * event)
{
// d->states &= ~IconWidgetPrivate::HoverState; // Will be set once progress is zero again ...
d->hoverEffect(false);
update();
QGraphicsWidget::dragLeaveEvent(event);
}
void IconWidget::setPressed(bool pressed)
{
if (pressed) {

View File

@ -283,6 +283,9 @@ protected:
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
public:
/**
* @internal