pyqt设置tablewidget滚动条
时间: 2023-06-27 10:06:45
浏览: 115
要设置QTableWid[get]([http](https://geek.csdn.net/educolumn/68f28ca3131d47699e5902c5d3d74d51?spm=1055.2569.3001.10083)s://geek.csdn.net/educolumn/31aebce56f4ecc5451aac3a194ff6259?spm=1055.2569.3001.10083)的滚动条,可以使用setVerticalScrollBarPolicy和setHorizontalScrollBarPolicy方法来指定滚动条的[可见性](https://geek.csdn.net/educolumn/566e7c26c9421a641f601efb455fcd63?dp_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6NDQ0MDg2MiwiZXhwIjoxNzA3MzcxOTM4LCJpYXQiOjE3MDY3NjcxMzgsInVzZXJuYW1lIjoid2VpeGluXzY4NjQ1NjQ1In0.RrTYEnMNYPC7AQdoij4SBb0kKEgHoyvF-bZOG2eGQvc&spm=1055.2569.3001.10083),例如:
```python
tableWid[get](https://geek.csdn.net/educolumn/31aebce56f4ecc5451aac3a194ff6259?spm=1055.2569.3001.10083).setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
tableWid[get](https://geek.csdn.net/educolumn/31aebce56f4ecc5451aac3a194ff6259?spm=1055.2569.3001.10083).setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
```