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

When setting custom styles with rounded corners for Qt controls, there is a shadow residue.

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.7.3, 6.8.2, 6.9.0 Beta2, 6.9.0 Beta3
    • Widgets: Styles
    • None
    • Windows

    Description

      In versions Qt6.7.3, 6.8.2, and 6.9.0beta, when I tried to customise the style of QMenu using QSS, I found that after removing the shadow, there was a residual black background in the bottom right corner, with the larger the rounded corners, the greater the affected area. However, in versions 6.5.3 and 6.5.2, I tested with the same code and this issue did not occur. Through my verification, it is not a problem with my code, but a bug in versions 7.x.x and above, including the new version, and I hope this bug can be resolved in the new version by the officials. Attached are two screenshots from the test, showing the effect clearly. Below is a simple test code:

      int main(int argc, char *argv[])
      {
      QApplication a(argc, argv);
      QPushButton btn("clicked");
      
      QMenu menu;
      menu.setMinimumSize(400, 400);
      menu.move(200, 200);
      menu.addAction(new QAction("1111111"));
      menu.setAttribute(Qt::WA_TranslucentBackground);
      menu.setWindowFlags(menu.windowFlags() | Qt::Popup | Qt::NoDropShadowWindowHint|Qt::FramelessWindowHint);
      menu.setStyleSheet("QMenu\{border: 2px solid red; border-radius:40px; background-color:black;}");
      QObject::connect(&btn, &QPushButton::clicked, [&]() {
      menu.exec();
      });
      
      btn.show();
      return a.exec();
      }
      

      Attachments

        1. 6.5.x.png
          6.5.x.png
          32 kB
        2. 9.x.x.png
          9.x.x.png
          13 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            tpochep Timur Pocheptsov
            mllx 皓 雪殇
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes