diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp index ef7207a8..5d841965 100644 --- a/src/widgets/util/qcompleter.cpp +++ b/src/widgets/util/qcompleter.cpp @@ -981,6 +981,16 @@ void QCompleterPrivate::showPopup(const QRect& rect) if (!popup->isVisible()) popup->show(); +#ifndef NO_FOR_WAYLAND + QWindow *win = widget->windowHandle(); + if (!win) { + QWidget *parentWidget = widget->nativeParentWidget(); + if (parentWidget) + win = parentWidget->windowHandle(); + } + if (win) + popup->windowHandle()->setTransientParent(win); +#endif } #if QT_CONFIG(filesystemmodel)