diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-10-23 14:01:35 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-10-23 14:45:03 +0200 |
commit | 790aef362fd195adf97d8c780a7cbbbade27d51f (patch) | |
tree | 8be464687ab21806cfe9f7ada27098b563aa41b2 /src/plugins/platforms/cocoa/qcocoahelpers.mm | |
parent | 9720efbd1035c2e939b0581163e6d804c713dd96 (diff) | |
parent | 07475c662eb73c833da2d461b8ef2702ca1e2cfb (diff) |
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
.qmake.conf
configure
src/corelib/global/qglobal.h
src/tools/qdoc/node.cpp
src/tools/qdoc/qdocdatabase.cpp
tests/auto/corelib/io/qsettings/tst_qsettings.cpp
tools/configure/configureapp.cpp
Change-Id: I66028ae5e441a06b73ee85ba72a03a3af3e8593f
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoahelpers.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoahelpers.mm | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm index 8ad80333f8..f51c21ee9b 100644 --- a/src/plugins/platforms/cocoa/qcocoahelpers.mm +++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm @@ -634,10 +634,14 @@ QString qt_mac_applicationName() int qt_mac_mainScreenHeight() { QMacAutoReleasePool pool; - // The first screen in the screens array is documented - // to have the (0,0) origin. - NSRect screenFrame = [[[NSScreen screens] firstObject] frame]; - return screenFrame.size.height; + NSArray *screens = [NSScreen screens]; + if ([screens count] > 0) { + // The first screen in the screens array is documented + // to have the (0,0) origin. + NSRect screenFrame = [[screens objectAtIndex: 0] frame]; + return screenFrame.size.height; + } + return 0; } int qt_mac_flipYCoordinate(int y) |