we no longer need to check for spontaneity; move the trick up to Applet as well to avoid repaints where possible

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=868200
This commit is contained in:
Aaron J. Seigo 2008-10-05 17:48:44 +00:00
parent f7b31b3372
commit 06e71be8c3
4 changed files with 24 additions and 26 deletions

View File

@ -1519,6 +1519,16 @@ QSizeF Applet::sizeHint(Qt::SizeHint which, const QSizeF & constraint) const
return hint;
}
void Applet::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
{
Q_UNUSED(event)
}
void Applet::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
{
Q_UNUSED(event)
}
void Applet::timerEvent(QTimerEvent *event)
{
if (d->transient) {

View File

@ -783,11 +783,21 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
/**
* Reimplemented from QGraphicsLayoutItem
*/
QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF()) const;
QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF()) const;
/**
* Reimplemented from QObject
*/
/**
* Reimplemented from QGraphicsLayoutItem
*/
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
/**
* Reimplemented from QGraphicsLayoutItem
*/
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
/**
* Reimplemented from QObject
*/
void timerEvent (QTimerEvent *event);
private:

View File

@ -1006,26 +1006,6 @@ void Containment::resizeEvent(QGraphicsSceneResizeEvent *event)
}
}
void Containment::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
{
//FIXME Qt4.4 check to see if this is still necessary to avoid unnecessary repaints
// check with QT_FLUSH_PAINT=1 and mouse through applets that accept hover,
// applets that don't and system windows
if (event->spontaneous()) {
Applet::hoverEnterEvent(event);
}
Q_UNUSED(event)
}
void Containment::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
{
//FIXME Qt4.4 check to see if this is still necessary to avoid unnecessary repaints
// check with QT_FLUSH_PAINT=1 and mouse through applets that accept hover,
// applets that don't and system windows
// Applet::hoverLeaveEvent(event);
Q_UNUSED(event)
}
void Containment::keyPressEvent(QKeyEvent *event)
{
//kDebug() << "keyPressEvent with" << event->key() << "and hoping and wishing for a" << Qt::Key_Tab;

View File

@ -461,8 +461,6 @@ class PLASMA_EXPORT Containment : public Applet
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
void contextMenuEvent(QGraphicsSceneContextMenuEvent *event);
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
void keyPressEvent(QKeyEvent *event);
void wheelEvent(QGraphicsSceneWheelEvent *event);
bool sceneEventFilter(QGraphicsItem *watched, QEvent *event);