Fix devicePixelRatio getter for embedded QWindows.
m_nsWindow is not set for non-toplevel QWindows, causing devicePixelRatio to always return 1. Use [m_contentView window] instead. Change-Id: I6689a70812c9484f103b5e706fe4c1b76406b750 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>bb10
parent
26817211d2
commit
5a46251de3
|
|
@ -837,11 +837,9 @@ QCocoaMenuBar *QCocoaWindow::menubar() const
|
|||
|
||||
qreal QCocoaWindow::devicePixelRatio() const
|
||||
{
|
||||
if (!m_nsWindow)
|
||||
return 1.0;
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
|
||||
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) {
|
||||
return qreal([m_nsWindow backingScaleFactor]);
|
||||
return qreal([[m_contentView window] backingScaleFactor]);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue