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:
parent
694c822bb0
commit
311d2bafd2
12
toolbox.cpp
12
toolbox.cpp
@ -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"
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user