Qt with Python size of headeritem in Qtablewidget

95 views Asked by At

I am developping a Gui using python and Qt. my problem is i can't set and fix a value for my columns.

I created a table called "tableWidget_Segment_List" with two columns (using qt designer)

I would like to set the first width column to 100px and the second one to 50px.

And fixed those values against the user.

thank you

1

There are 1 answers

0
BigTailWolf On

You can do it in either way:

  1. In your QtDesigner, right click on your widget, select "changeStyleSheet"

  2. In your script code, do

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