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
Morten Johan Sørvig 2013-01-29 09:11:21 +01:00 committed by The Qt Project
parent 26817211d2
commit 5a46251de3
1 changed files with 1 additions and 3 deletions

View File

@ -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
{