From 46016d0efe3309997ac3f1480bf0eda750a3971d Mon Sep 17 00:00:00 2001 From: hanpinlong Date: Thu, 13 Jun 2024 19:40:14 +0800 Subject: [PATCH] wayland qcompleter popup --- src/widgets/util/qcompleter.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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)