如何去除QPushButton的默认阴影?

How to remove the default shadow of QPushButton?

如何去掉下面箭头所指的阴影?

我搜索了一些解决方案,但没有找到好的答案。

只需将边框设置为none:

QPushButton {
    color: #ffffff; 
    background-color: #EA382A; 
    border: none; 
}

QPushButton:hover {
    color: #EA382A; 
    background-color: #ffffff; 
}

QPushButton:pressed {
    color: #ffffff; 
    background-color: #EA382A; 
}

通过将边框设置为“透明”,您将得到如下图所示的结果

QPushButton{
  background-color: rgb(234, 56, 42);
  color:white;
  border:transparent;
}