added toggled() signal in the toolbox emitted upon mouse click.

will be needed for the panel toolbox.
and removing two pure virtual methods already declared in QGraphicsItem

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=801445
This commit is contained in:
Marco Martin 2008-04-26 17:31:49 +00:00
parent 694c822bb0
commit 311d2bafd2
2 changed files with 17 additions and 2 deletions

View File

@ -154,6 +154,18 @@ void Toolbox::setOrientation( Qt::Orientation orient )
d->orientation = orient;
}
void Toolbox::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
event->accept();
}
void Toolbox::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
if (boundingRect().contains(event->pos())) {
emit toggled();
}
}
} // plasma namespace
#include "toolbox_p.moc"

View File

@ -55,9 +55,12 @@ public:
virtual void showToolbox() = 0;
virtual void hideToolbox() = 0;
Q_SIGNALS:
void toggled();
protected:
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event) = 0;
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) = 0;
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
private:
class Private;