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:
parent
a32217cb55
commit
66fcd0cf66
@ -1869,9 +1869,8 @@ void QTabBar::mouseMoveEvent(QMouseEvent *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int offset = (event->pos() - d->dragStartPosition).manhattanLength();
|
|
||||||
if (event->buttons() == Qt::LeftButton
|
if (event->buttons() == Qt::LeftButton
|
||||||
&& offset > QApplication::startDragDistance()
|
&& d->dragInProgress
|
||||||
&& d->validIndex(d->pressedIndex)) {
|
&& d->validIndex(d->pressedIndex)) {
|
||||||
bool vertical = verticalTabs(d->shape);
|
bool vertical = verticalTabs(d->shape);
|
||||||
int dragDistance;
|
int dragDistance;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user