From 89e594293b5a1d2bf86e3424196c81a42d4ba17d Mon Sep 17 00:00:00 2001 From: Ye ShanShan Date: Wed, 3 Jul 2024 15:56:30 +0800 Subject: [PATCH] fix: can't set transparent for Menu's background Menu's background always fill a color even it's transparent. in somecase we need fill background by caller. --- styleplugins/chameleon/chameleonstyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/styleplugins/chameleon/chameleonstyle.cpp b/styleplugins/chameleon/chameleonstyle.cpp index 2101c0b3..e390cd0f 100644 --- a/styleplugins/chameleon/chameleonstyle.cpp +++ b/styleplugins/chameleon/chameleonstyle.cpp @@ -2812,7 +2812,7 @@ void ChameleonStyle::drawMenuItemBackground(const QStyleOption *option, QPainter } else { color = option->palette.window().color(); - if (color.color().isValid()) { + if (color.color().isValid() && color.color() != Qt::transparent) { QColor c = color.color(); // 未开启窗口混成时不应该设置背景色的alpha通道,应当显示纯色背景(设置StyleSheet时,不加载此设置,防止alpha通道等对其造成影响)