Fixes the year toolbutton hover bug in Plasma::Calendar.

svn path=/trunk/KDE/kdelibs/; revision=1147175
This commit is contained in:
Davide Bettio 2010-07-07 14:24:38 +00:00
parent b94b7b1d54
commit 3cf1e32282
2 changed files with 12 additions and 0 deletions

View File

@ -445,6 +445,17 @@ void ToolButton::changeEvent(QEvent *event)
QGraphicsProxyWidget::changeEvent(event);
}
QVariant ToolButton::itemChange(GraphicsItemChange change, const QVariant &value)
{
//If the widget is hidden while it's hovered and then we show it again
//we have to disable the hover otherwise it will remain hovered.
if (change == ItemVisibleHasChanged){
d->underMouse = false;
}
return QGraphicsProxyWidget::itemChange(change, value);
}
QSizeF ToolButton::sizeHint(Qt::SizeHint which, const QSizeF & constraint) const
{
QSizeF hint = QGraphicsProxyWidget::sizeHint(which, constraint);

View File

@ -183,6 +183,7 @@ protected:
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
void changeEvent(QEvent *event);
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint) const;
private slots: