Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-28574

userSpaceScaleFactor deprecated and should not be used anymore

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 4.8.4, 5.0.0 Beta 2, 5.0.0 RC 1
    • Fix Version/s: 5.1.0
    • Component/s: Core: Plugins
    • Labels:
      None
    • Environment:
      MAC OS X 10.7 ->
    • Commits:
      e307d6074942eba356ecd4dceabf1def9a92719e

      Description

      userSpaceScaleFactor is deprecated from MAC OS X 10.7 onwards and should be replaced with backingScaleFactor.

      In Qt 5:
      qt/qtbase/src/plugins/platforms/cocoa/qcocoahelpers.mm:

          
      return [[NSScreen mainScreen] userSpaceScaleFactor];
      

      In Qt 4.8:
      qt/src/gui/kernel/qt_cocoa_helpers_mac.mm

      The attached patch can be used:

      --- a/src/gui/kernel/qt_cocoa_helpers_mac.mm
      +++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm
      @@ -1560,8 +1560,12 @@ CGFloat qt_mac_get_scalefactor()
       #ifndef QT_MAC_USE_COCOA
           return HIGetScaleFactor();
       #else
      +#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
      +    return [[NSScreen mainScreen] backingScaleFactor];
      +#else
           return [[NSScreen mainScreen] userSpaceScaleFactor];
       #endif
      +#endif
      

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            andysh Andy Shaw
            Reporter:
            qtcomsupport Qt Support
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes