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

Unexpected black border around the object painted by paintEvent() of a frameless QWidget with translucent background in dark mode

    XMLWordPrintable

Details

    • macOS

    Description

      Reproducer attached. The dark mode can either set by

      void callNSMethod() {
        [NSApp setAppearance:[NSAppearance
                                     appearanceNamed:NSAppearanceNameDarkAqua]];
      }
      

      as what is done in reproducer, or by system "Appearence" setting. Either can trigger the issue.

      The issue is that the rectangle painted inside paintEvent() is somehow surrounded by black border, even though there is no code for such border. There is no such border in light mode.

      It is said that unsetting Qt::FramelessWindowHint also solves the border problem in dark mode.

      2 screenshots are also attached to illustrate the problem.

      Attachments

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

        Activity

          People

            axelspoerl Axel Spoerl
            luqiaochen Luqiao Chen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes