From c0e1e0010f6feb6532486135dd77a1a4cdc72831 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 16 Jul 2024 12:43:16 +0300 Subject: [PATCH] Partially revert cccaa8f89897146043a535d45a276e3a57412815 The widget may not be properly integrated into the widget tree when KJobWidgets::setWindow() is called. (cherry picked from commit 185e946c8b918471ee5164815d3296bc06d8a2e7) --- src/kjobwidgets.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/kjobwidgets.cpp b/src/kjobwidgets.cpp index b092a2e0..a64a422e 100644 --- a/src/kjobwidgets.cpp +++ b/src/kjobwidgets.cpp @@ -14,15 +14,8 @@ void KJobWidgets::setWindow(QObject *job, QWidget *widget) { job->setProperty("widget", QVariant::fromValue(widget)); - QWindow *windowHandle = nullptr; - if (widget) { - QWidget *window = widget->window(); - if (window->winId()) { - windowHandle = window->windowHandle(); - } - } - - setWindowHandle(job, windowHandle); + QWindow *window = widget ? widget->windowHandle() : nullptr; + setWindowHandle(job, window); } void KJobWidgets::setWindowHandle(QObject *job, QWindow *window) -- 2.45.2