Cocoa: prevent scale factor value of 0.
Check that the NSWindow pointer is valid before calling backingScaleFactor. Change-Id: Ia23cbb4058b7d0fece008bc437f8bfec6c0ddebe Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
This commit is contained in:
parent
52a317092e
commit
393fcf69dc
@ -67,7 +67,7 @@ QPaintDevice *QCocoaBackingStore::paintDevice()
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
|
||||
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) {
|
||||
QCocoaWindow *cocoaWindow = static_cast<QCocoaWindow *>(window()->handle());
|
||||
if (cocoaWindow && cocoaWindow->m_contentView) {
|
||||
if (cocoaWindow && cocoaWindow->m_contentView && [cocoaWindow->m_contentView window]) {
|
||||
scaleFactor = int([[cocoaWindow->m_contentView window] backingScaleFactor]);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user