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

qmacstyle_mac.mm fails to compile with 32-bit mkspec

    Details

    • Platform/s:
      macOS
    • Commits:
      a43684c0da78e7187fd2f4fc05791064174da9de

      Description

      Building Qt 5 using macx-clang-32 results in the following errors:

      ....
      /SDKs/MacOSX10.9.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/AGL.framework/Headers -F/Users/bertus/Projects/email_designer/lib/vendor/qt/5.4.0/qtbase/lib widgets/qmenu_mac.mm -o .obj/debug/qmenu_mac.o
      styles/qmacstyle_mac.mm:5575:72: error: no viable conversion from 'const HIRect' (aka 'const CGRect') to 'NSRect' (aka '_NSRect')
                                                      [sl.cell drawBarInside:tdi.bounds flipped:NO];
                                                                             ^~~~~~~~~~
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSGeometry.h:60:16: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'const HIRect' (aka 'const CGRect') to 'const _NSRect &' for 1st argument
      typedef struct _NSRect {
                     ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSGeometry.h:60:16: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'const HIRect' (aka 'const CGRect') to '_NSRect &&' for 1st argument
      typedef struct _NSRect {
                     ^
      /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSliderCell.h:67:31: note: passing argument to parameter 'aRect' here
      - (void)drawBarInside:(NSRect)aRect flipped:(BOOL)flipped;
      ....
      

      This has reappear on QT 5.4.0 (see https://bugreports.qt.io/browse/QTBUG-27335)

      I added a comment there with the solution:

      On qtbase/src/widgets/styles/qmacstyle_mac.mm#5575

      [sl.cell drawBarInside:tdi.bounds flipped:NO];
      

      Needs to be

      [sl.cell drawBarInside:NSRectFromCGRect(tdi.bounds) flipped:NO];
      

        Attachments

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

          Activity

            People

            • Assignee:
              sorvig Morten Sørvig
              Reporter:
              sinspiral Alberto Fdez
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes