Fix possible stack overflow crash.

This commit is contained in:
John Preston 2022-06-20 23:44:44 +04:00
parent dbc0e87c80
commit 9ebfd80b29

View file

@ -254,6 +254,7 @@ void ScrollBar::mousePressEvent(QMouseEvent *e) {
if (!width() || !height()) return; if (!width() || !height()) return;
_dragStart = e->globalPos(); _dragStart = e->globalPos();
area()->setMovingByScrollBar(true);
setMoving(true); setMoving(true);
if (_overbar) { if (_overbar) {
_startFrom = _connected->value(); _startFrom = _connected->value();
@ -265,15 +266,12 @@ void ScrollBar::mousePressEvent(QMouseEvent *e) {
_connected->setValue(_startFrom); _connected->setValue(_startFrom);
setOverBar(true); setOverBar(true);
} }
area()->setMovingByScrollBar(true);
} }
void ScrollBar::mouseReleaseEvent(QMouseEvent *e) { void ScrollBar::mouseReleaseEvent(QMouseEvent *e) {
if (_moving) { if (_moving) {
setMoving(false);
area()->setMovingByScrollBar(false); area()->setMovingByScrollBar(false);
setMoving(false);
} }
if (!_over) { if (!_over) {
setMouseTracking(false); setMouseTracking(false);