diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-12-09 19:16:34 +0100 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2021-02-11 09:55:07 +0200 |
commit | b936d5eb3af4ff329bdaf745162ef340abd08df1 (patch) | |
tree | 9473108295c4d23e97fe7dfee57aba8e0598db81 | |
parent | 92e813b1b7c2cf3398946fab873841f828c21b9f (diff) |
macOS: Remove warning about KVO observers on QNSWindow/QNSPanel
NSTitleBarView in Big Sur will observe the window it is in, but makes
sure to remove these observers in viewWillMoveToWindow, as it should.
To avoid spamming user logs with this warning we remove it.
It was dubious what cases it would have caught anyways, as anyone
trying to KVO observe properties Z of a child object Y of X.Y would
need to track whether X changes its Y between adding and removing
the observer. There are no guarantees that Y is stable, and this
applies to an NSView's window property as well.
Change-Id: I27a0d04625f96c4c5d382c39ac068721ce1e8f9d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b58d6831de79ad21463e20c079093667918ee626)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.mm | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index c75a6936d5..1b1b2b8441 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -1459,11 +1459,6 @@ void QCocoaWindow::recreateWindowIfNeeded() if ((isContentView() && !shouldBeContentView) || (recreateReason & PanelChanged)) { if (m_nsWindow) { qCDebug(lcQpaWindow) << "Getting rid of existing window" << m_nsWindow; - if (m_nsWindow.observationInfo) { - qCCritical(lcQpaWindow) << m_nsWindow << "has active key-value observers (KVO)!" - << "These will stop working now that the window is recreated, and will result in exceptions" - << "when the observers are removed. Break in QCocoaWindow::recreateWindowIfNeeded to debug."; - } [m_nsWindow closeAndRelease]; if (isContentView() && !isEmbeddedView) { // We explicitly disassociate m_view from the window's contentView, |