【问题标题】:Qt with Python size of headeritem in QtablewidgetQt与Qtablewidget中headeritem的Python大小
【发布时间】:2015-06-18 20:33:42
【问题描述】:

我正在使用 python 和 Qt 开发一个 Gui。 我的问题是我无法设置和修复列的值。

我创建了一个名为“tableWidget_Segment_List”的表,其中包含两列(使用 qt 设计器)

我想将第一个宽度列设置为 100 像素,第二个设置为 50 像素。

并针对用户修复了这些值。

谢谢

【问题讨论】:

    标签: python qt qtablewidget


    【解决方案1】:

    你可以用任何一种方式来做:

    1. 在您的 QtDesigner 中,右键单击您的小部件,选择“changeStyleSheet”

    2. 在你的脚本代码中,做

      table.setColumnWidth(1, 100)
      table.setColumnWidth(2, 50)
      

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-28
      • 1970-01-01
      • 1970-01-01
      • 2018-12-11
      相关资源
      最近更新 更多