update the hover pos to make the entry point the last hovered location

BUG:172075

svn path=/trunk/KDE/kdelibs/; revision=882611
This commit is contained in:
Aaron J. Seigo 2008-11-11 00:57:08 +00:00
parent 76d9ad90d4
commit 4e964a2ec8
3 changed files with 12 additions and 1 deletions

View File

@ -1080,7 +1080,12 @@ bool Containment::sceneEventFilter(QGraphicsItem *watched, QEvent *event)
//kDebug() << "got hoverenterEvent" << immutability() << " " << applet->immutability();
if (immutability() == Mutable && applet->immutability() == Mutable) {
QGraphicsSceneHoverEvent *he = static_cast<QGraphicsSceneHoverEvent*>(event);
if (!d->handles.contains(applet)) {
if (d->handles.contains(applet)) {
AppletHandle *handle = d->handles.value(applet);
if (handle) {
handle->setHoverPos(he->pos());
}
} else {
//kDebug() << "generated applet handle";
AppletHandle *handle = new AppletHandle(this, applet, he->pos());
d->handles[applet] = handle;

View File

@ -926,6 +926,11 @@ void AppletHandle::appletResized()
update();
}
void AppletHandle::setHoverPos(const QPointF &hoverPos)
{
m_entryPos = hoverPos;
}
void AppletHandle::startFading(FadeType anim, const QPointF &hoverPos)
{
if (m_animId != 0) {

View File

@ -64,6 +64,7 @@ class AppletHandle : public QObject, public QGraphicsItem
QPainterPath shape() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
void startFading(FadeType anim, const QPointF &hoverPos);
void setHoverPos(const QPointF &hoverPos);
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event);