QAbstractScrollArea: when used as a popup, apply regular popup behavior

QWidget::mousePressEvent is documented to implement the closing of
popups if the widget is a popup. QAbstractScrollArea is one of the
QWidget subclasses that might be used as a popup as well, so instead of
just ignoring mousePressEvents, pass the event on to the QWidget
implementation for regular popup handling.

Change-Id: I05f77a334945f3c167f729f30bc022599230379b
Fixes: QTBUG-60885
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
This commit is contained in:
Volker Hilsheimer 2019-10-08 16:25:08 +02:00 committed by Tor Arne Vestbø
parent f1dd6addda
commit 65fcd8524d

View File

@ -1144,11 +1144,14 @@ void QAbstractScrollArea::paintEvent(QPaintEvent*)
mouse press events for the viewport() widget. The event is passed mouse press events for the viewport() widget. The event is passed
in \a e. in \a e.
The default implementation calls QWidget::mousePressEvent() for
default popup handling.
\sa QWidget::mousePressEvent() \sa QWidget::mousePressEvent()
*/ */
void QAbstractScrollArea::mousePressEvent(QMouseEvent *e) void QAbstractScrollArea::mousePressEvent(QMouseEvent *e)
{ {
e->ignore(); QWidget::mousePressEvent(e);
} }
/*! /*!