Fix possible stack overflow crash.
This commit is contained in:
parent
dbc0e87c80
commit
9ebfd80b29
1 changed files with 2 additions and 4 deletions
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue