macOS: Replace [QNSView drawRect:] assert with warning

AppKit will in some cases call this method, even if we are layer backed,
just because we implement it. We should remove the implementation, but
doing so requires us to also move from displayLayer to updateLayer for
the layer backed drawing, which requires more testing.

Pick-to: 6.5
Fixes: QTBUG-113500
Change-Id: I70bde34fdb433105d85ccea0514a5342e2c1e725
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
Tor Arne Vestbø 2023-05-10 11:26:51 +02:00
parent 6da9662143
commit 1ea0625ca8

View File

@ -178,8 +178,10 @@
- (void)drawRect:(NSRect)dirtyBoundingRect
{
Q_UNUSED(dirtyBoundingRect);
Q_ASSERT_X(!self.layer, "QNSView",
"The drawRect code path should not be hit when we are layer backed");
// As we are layer backed we shouldn't really end up here, but AppKit will
// in some cases call this method just because we implement it.
// FIXME: Remove drawRect and switch from displayLayer to updateLayer
qCWarning(lcQpaDrawing) << "[QNSView drawRect] called for layer backed view";
}
/*