How to proportionally adjust column widths in a QTableView?
问题 I want to proportionally change the column width of all columns in a QTableView widget, so that each column has the same width regardless of the data. For example, if a table has three columns, each column should always have a width of one third of the available horizontal space - and the width should be automatically updated whenever the dialog is resized by the user. So far I've only managed to resize columns to their contents, which is not what I want. Here's the code I've got so far: main