QPalette overPalette; //走过的步骤
QColor color(219, 226, 241); //默认透明度为1.0
overPalette.setColor(QPalette::WindowText, color);
QPalette normalPalette; //正常的步骤
color.setAlphaF(0.3); //设置透明度为0.3
normalPalette.setColor(QPalette::WindowText, color);
ui.lable_FR->setPalette(normalPalette);
Warning: Some styles do not use the palette for all drawing, for instance, if they make use of native theme engines. This is the case for both the Windows XP, Windows Vista, and the Mac OS X styles.
Style sheets let you perform all kinds of customizations that are difficult or impossible to perform using QPalette alone
所以尽量使用设置样式表的方法