Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
6.5
-
None
Description
In our macOS applications we embed QQuickWindows into our application's main NSView. One such window is embedded before being shown - it is shown later in the application lifetime.
In Qt 6.5 the `QQuickItemPrivate::calcEffectiveVisible` function changed from
bool QQuickItemPrivate::calcEffectiveVisible() const { // XXX todo - Should the effective visible of an element with no parent just be the current // effective visible? This would prevent pointless re-processing in the case of an element // moving to/from a no-parent situation, but it is different from what graphics view does. return explicitVisible && (!parentItem || QQuickItemPrivate::get(parentItem)->effectiveVisible); }
into:
bool QQuickItemPrivate::calcEffectiveVisible() const { // An item is visible if it is a child of a visible parent, and not explicitly hidden. return explicitVisible && parentItem && QQuickItemPrivate::get(parentItem)->effectiveVisible; }
With this change, when we call show on our initially hidden embedded QQuickWindow , the content item never changes its visibility to `true` - it simply remains false. We can work around this issue by including private headers and doing the following:
QObject::connect(window, &QQuickWindow::visibleChanged, [window]() { if (window->isVisible()) { QQuickItemPrivate::get(window->contentItem())->setEffectiveVisibleRecur(true); } });
However, this is obviously not ideal. I would expect a such a call to `setEffectiveVisibleRecur(true)` to be made on the window's content item on `QQuickWindow::show`. Could it be that this was missed out in the refactor of `calcEffectiveVisible` ?
Thanks.