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

Qt apps producing strange error messages on MacOS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.8.2
    • None
    • MacOS Sonoma 14.7.3, Command line tools, Qt 6.8.2
    • macOS

    Description

      Every Qt app I build on macOS when run in the lldb debugger seems to produce endless numbers of the following error message:

      
      2025-02-27 13:01:53.359371-0500 Sigil[2522:53876] [miscellany] CLIENT ERROR: TUINSRemoteViewController does not override -viewServiceDidTerminateWithError: and thus cannot react to catastrophic errors beyond logging them
      
      

      I spent some time tracking it down and found the following information from various posters on the web:

      It seems to be related to interacting with a NSView.

      It turns out the problem was a change that Apple made to NSView in MacOS 14. The bug was caused when Apple decided to change the default return value of NSView.clipsToBounds. By setting that to true the code works again and the Error message is gone. Here's an explanation -

      And that pointed me to the following:

      <From the Apple Developer Website>
      NSView
      In macOS 14, AppKit is exposing the clipsToBounds property of NSView.
      For applications linked against the macOS 14 SDK, the default value of this property is false. Apps linked against older SDKs default to true. Some classes, like NSClipView, continue to default to true. The change in defaults recognizes that it is vastly easier to reason about clipping a view's descendants than it is to unclip a view's ancestors.
      Users can turn clipping back on by using the NSView.clipsToBounds setter or using the attributes inspector of a view in the Xcode interface builder.
      This property is available back to macOS 10.9. This availability is intended to allow code targeting older OSes to set this property to true without guarding the setter in an availability check. Setting this property to false on previous OSes may not work reliably.
      Some patterns that have historically worked will require adjustment:
      Showing or hiding UI by setting an ancestor's frame to zero. When attempting to hide a view hierarchy by shrinking the size of an ancestor, or positioning a descendent view outside an ancestors view's bounds, it is now necessary to set the ancestor's view's .clipsToBounds property to true. An alternative may be to set NSView.isHidden, instead.
      Filling the dirty rect of a view inside of -drawRect. A fairly common pattern is to simply rect fill the dirty rect passed into an override of NSView.draw(). The dirty rect can now extend outside of your view's bounds. This pattern can be adjusted by filling the bounds instead of the dirty rect, or by setting clipsToBounds = true.
      Confusing a view's bounds and its dirty rect. The dirty rect passed to .drawRect() should be used to determine what to draw, not where to draw it. Use NSView.bounds when determining the layout of what your view draws. (10905750)
      
      

      Does the Qt macOS gui plugin require changes to support the setting of the clipsToBounds property of NSView to be true?

      These error messages are filling the log making it actually hard to find and see actual debug information and confusing bug reporters into thinking an real error has happened.

      Please consider making the necessary changes to stop the generation of these error messages by the macOS plugin gui code.

      Thank you.

      Attachments

        1. bgcbug.zip
          2 kB
        2. bug_report.zip
          3 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            srutledg Shawn Rutledge
            kevinhendricks Kevin B. Hendricks
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes