Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.7.3, 6.8.2, 6.9.0 Beta2, 6.9.0 Beta3
-
None
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(); }