pyqt - QTableView/QTableWidget : Stretch Last Column using Qt Designer

标签 pyqt pyqt4 qt-designer pyqt5

我正在尝试在 PyQt 中拉伸(stretch) QTableView/QTableWidget 的最后一个 header 。通过将值硬编码到文件中,已经提出了有关此主题的多个问题,例如:

Qt table last column not stretching to fill in parent

How to stretch QTableView last column header

但是如何通过 Qt Designer 实现这一点呢?

Before

最佳答案

在 Qt Designer 中,选择 QTableWidget/QTableView 并导航到属性编辑器。在这里,向下滚动到“标题部分”并启用horizo​​ntalHeaderStretchLastSection

Qt Designer Property Box Qt After stretch

关于pyqt - QTableView/QTableWidget : Stretch Last Column using Qt Designer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29855712/

相关文章:

python - 我可以使用 setup.py 打包需要 PyQt5 的应用程序吗?

python - 如何合理利用线程池来完成多个海量计算任务?

c++ - 向 Qt Designer 添加小部件

python - 使用 Pyside 从主窗口打开子对话窗口

python - PyQt4 QTableWidget : Set row width and column height to fill parent widget

python - MainWindow 初始化后关闭

python - 使用 Qlistview 设置 QStandarItemModel 中项目的选择

python - 尝试在 PyQT5 中打开文件时出现无效文件错误

python - PyQt4 : Window shows up at another position after hide() and show()

python - QPixmap保持纵横比