event->button() is usually empty, do drags only with the left buttons (and find the down position with that too) instead

BUG:198814

svn path=/trunk/KDE/kdelibs/; revision=1137301
This commit is contained in:
Marco Martin 2010-06-12 09:51:42 +00:00
parent c77396e412
commit 6f8d808068

View File

@ -590,8 +590,9 @@ void ExtenderItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
void ExtenderItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
QPoint mousePressPos = event->buttonDownPos(event->button()).toPoint();
if ((event->pos().toPoint() - mousePressPos).manhattanLength()
QPoint mousePressPos = event->buttonDownPos(Qt::LeftButton).toPoint();
if (!(event->buttons() & Qt::LeftButton) ||
(event->pos().toPoint() - mousePressPos).manhattanLength()
< QApplication::startDragDistance()) {
return;
}
@ -664,6 +665,7 @@ void ExtenderItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
drag->setPixmap(pixmap);
drag->setMimeData(mimeData);
drag->setHotSpot(mousePressPos);
Qt::DropAction action = drag->exec();
corona->removeOffscreenWidget(this);