only toggle on left click and let other click go through

svn path=/trunk/KDE/kdelibs/; revision=1017716
This commit is contained in:
Aaron J. Seigo 2009-08-31 09:30:13 +00:00
parent 27b2236e2d
commit 88faa0813f

View File

@ -214,9 +214,13 @@ ToolBox::Corner ToolBox::corner() const
void ToolBox::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
if (event->button() == Qt::LeftButton) {
event->accept();
// set grab position relative to toolbox
d->dragStartRelative = mapToParent(event->pos()).toPoint() - pos().toPoint();
} else {
event->ignore();
}
}
QSize ToolBox::cornerSize() const
@ -335,7 +339,7 @@ void ToolBox::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
void ToolBox::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
if (!d->dragging && boundingRect().contains(event->pos())) {
if (event->button() == Qt::LeftButton && !d->dragging && boundingRect().contains(event->pos())) {
emit toggled();
}