summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorInho Lee <[email protected]>2024-09-27 10:33:59 +0200
committerJani Heikkinen <[email protected]>2024-10-01 09:57:38 +0000
commit063783b1441243d4fad632121b27ff98fc8fdbdb (patch)
treebe6dfcc38c9642783a17d3481b780f1999678518
parente9778e6026a68ce3d32bbe841e4b569d55963e97 (diff)
widgets: Send Window{AboutToChange}Internal when top level used RHI
When calling setParent for a top-level widget that used RHI it's not enough to check if the widget's parent used RHI, as that's always going to be false. Missing this results in not sending textureChildren events for the reparented widget. Amends eb4cb719257d3b57cd801273d4011579d8c81714 Fixes: QTBUG-129299 Change-Id: I632d8d63ec56243cd6da2b196ad9651c28128f0b Reviewed-by: Tor Arne Vestbø <[email protected]>
-rw-r--r--src/widgets/kernel/qwidget.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 4c8a3e90746..881c8ba9a4a 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -10757,8 +10757,9 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f)
// texture-based widgets need a pre-notification when their associated top-level window changes
// This is not under the wasCreated/newParent conditions above in order to also play nice with QDockWidget.
- const bool oldParentUsesRhiFlush = oldParentWithWindow ? oldParentWithWindow->d_func()->usesRhiFlush : false;
- if (oldParentUsesRhiFlush && ((!parent && parentWidget()) || (parent && parent->window() != oldtlw)))
+ const bool oldWidgetUsesRhiFlush = oldParentWithWindow ? oldParentWithWindow->d_func()->usesRhiFlush
+ : oldtlw->d_func()->usesRhiFlush;
+ if (oldWidgetUsesRhiFlush && ((!parent && parentWidget()) || (parent && parent->window() != oldtlw)))
qSendWindowChangeToTextureChildrenRecursively(this, QEvent::WindowAboutToChangeInternal);
// If we get parented into another window, children will be folded
@@ -10839,7 +10840,7 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f)
// texture-based widgets need another event when their top-level window
// changes (more precisely, has already changed at this point)
- if (oldParentUsesRhiFlush && oldtlw != window())
+ if (oldWidgetUsesRhiFlush && oldtlw != window())
qSendWindowChangeToTextureChildrenRecursively(this, QEvent::WindowChangeInternal);
if (!wasCreated) {