Qt第四十五章:QComboBox 禁止滚轮

Myth丶恋晨 2024-03-30 11:19 219阅读 0赞

很简单,直接反射将QComboBox的wheelEvent方法重置掉即可。

  1. self.combo_box = QComboBox(self)
  2. setattr(self.combo_box, "wheelEvent", lambda a: None)

发表评论

表情:
评论列表 (有 0 条评论,219人围观)

还没有评论,来说两句吧...

相关阅读