Remove QComboBox listView shadow effect

后端 未结 2 594
滥情空心
滥情空心 2021-01-18 18:24

By default, the QComboBox listview has shadow effect. Is there a way to remove it? Is the shadow controlled from QStyle or in some other way?

2条回答
  •  不思量自难忘°
    2021-01-18 18:58

    Okay, that might be working for someone who has themes without shadow effects but I have them, so I finally found a simple way to make it work.

    self.comboBox.findChild(QFrame).setWindowFlags(Qt.Popup | Qt.NoDropShadowWindowHint)
    

    combobox has one QFrame inside. Its window effect makes the shadow. We can erase that effect with the aforementioned line. Careful, don't put both, otherwise you won't open the popup.

    I know it's been a while since this post was made but I haven't found any other solutions.

提交回复
热议问题