QWidget的子类窗口如要正常显示背景色,需要 setAttribute(Qt::WA_StyledBackground);
目的是脱离父窗口的样式。
来自 https://blog.csdn.net/u012199908/article/details/50325569 中 shmiloveyou 的评论
加了 setAttribute(Qt::WA_StyledBackground);
就没问题了
QWidget的子类窗口如要正常显示背景色,需要 setAttribute(Qt::WA_StyledBackground);
目的是脱离父窗口的样式。
来自 https://blog.csdn.net/u012199908/article/details/50325569 中 shmiloveyou 的评论
加了 setAttribute(Qt::WA_StyledBackground);
就没问题了