Call raise on the window that contains the widget and not the widget

When the mouse is clicked on the widget in a window while a popup is
visible then it should raise just the window and not the widget inside it.
If the widget is in a stacked layout then calling raise() on it can cause
it to appear on top so avoid this by calling raise() directly on the
window.

Task-number: QTBUG-52670
Change-Id: Idd287c6cc7038c57e14e92f4a3e1c50985925684
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
Andy Shaw 2016-10-14 13:05:00 +02:00
parent f6eb570c7d
commit 843247e1c5

View File

@ -529,7 +529,7 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
// activate window of the widget under mouse pointer
if (!w->isActiveWindow()) {
w->activateWindow();
w->raise();
w->window()->raise();
}
QWindow *win = w->windowHandle();