Fix texture-based non-native child of a non-texture-based native child
Another one in the series of problems around having texture-based and regular widgets in hierarchies where some widgets are native and some are not. Fixes: QTBUG-115652 Task-number: QTBUG-108344 Task-number: QTBUG-113557 Change-Id: I34306503cb17ccb915b90168ec3f39e209f668e5 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 373c08d03d39b6933a16a5b839aa7ae271cede42) Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
parent
3e1a7eeabb
commit
3e09f3abbb
@ -10865,11 +10865,19 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f)
|
||||
// problematic when it comes to large widget trees.
|
||||
if (q_evaluateRhiConfig(this, nullptr, &surfaceType)) {
|
||||
newtlw->d_func()->usesRhiFlush = true;
|
||||
bool recreate = false;
|
||||
if (QWindow *w = newtlw->windowHandle()) {
|
||||
if (w->surfaceType() != surfaceType) {
|
||||
newtlw->destroy();
|
||||
newtlw->create();
|
||||
}
|
||||
if (w->surfaceType() != surfaceType)
|
||||
recreate = true;
|
||||
}
|
||||
// QTBUG-115652: Besides the toplevel the nativeParentWidget()'s QWindow must be checked as well.
|
||||
if (QWindow *w = d->windowHandle(QWidgetPrivate::WindowHandleMode::Closest)) {
|
||||
if (w->surfaceType() != surfaceType)
|
||||
recreate = true;
|
||||
}
|
||||
if (recreate) {
|
||||
newtlw->destroy();
|
||||
newtlw->create();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user