Fixed glitch when dragging a movable QTabBar tab

When you would start to drag a tab, and then drag it in the other
direction along the point where you started the drag, the tab would fail
to follow the mouse for a distance twice the "startDragDistance", before
jumping to the mouse again.

Fixed this by only taking into account the "startDragDistance" when
checking whether a drag is started, and to rely on the "dragInProgress"
variable otherwise.

Change-Id: I5dd4ebd8340fef7e870f087be68c5097b49728cb
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
Thorbjørn Lindeijer 2016-09-06 11:38:18 +02:00
parent a32217cb55
commit 66fcd0cf66

View File

@ -1869,9 +1869,8 @@ void QTabBar::mouseMoveEvent(QMouseEvent *event)
}
}
int offset = (event->pos() - d->dragStartPosition).manhattanLength();
if (event->buttons() == Qt::LeftButton
&& offset > QApplication::startDragDistance()
&& d->dragInProgress
&& d->validIndex(d->pressedIndex)) {
bool vertical = verticalTabs(d->shape);
int dragDistance;