summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@digia.com>2013-01-29 09:11:21 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-11 08:35:03 +0100
commit5a46251de36e568513bca70b82a1d6cc9c9cb0f3 (patch)
tree502fae7a14d0c61cf4f397d5538370a40b8cd945 /src/plugins/platforms/cocoa
parent26817211d27366f4f9d502fd3e4816a1acfc8bba (diff)
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>
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 14d62c9fca..45100f9906 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -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
{