QScrollBar: handle QWheelEvent::Phase for transient scrollbars

Transient scrollbars should become and stay visible when touching the
pad with two fingers.

Change-Id: Ic36ba56019f484cedb2404550551ebe68ea6f285
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
This commit is contained in:
J-P Nurmi 2013-08-05 13:51:13 +02:00 committed by The Qt Project
parent 73251f22f3
commit 865b43dbf3

View File

@ -510,6 +510,11 @@ void QScrollBar::wheelEvent(QWheelEvent *event)
Q_D(QScrollBar);
if (d->scrollByDelta(event->orientation(), event->modifiers(), delta))
event->accept();
if (event->phase() == QWheelEvent::Started)
d->setTransient(false);
else if (event->phase() == QWheelEvent::Ended)
d->setTransient(true);
}
#endif