Re: [Interest] QTableView Column Width and Headers

2024-05-29 Thread Volker Hilsheimer via Interest


On 24 May 2024, at 20:39, Michael Jackson  wrote:

I have a question about how the column widths of a QTableView are calculated? 
How can I have the QTableView set the column with “to contents” that includes 
the QHeader also? For example I have a QHeaderView with the first “section” 
that has text “This is a really really really long header”, but the actual data 
that is in the QTableView under that header are short values such as “100” or 
“2” or “1.231”. When the QTableView is rendered the the column with is only as 
wide as the QTableView. It is like the QHeaderView is not taken into account 
when calculating the width of the column.

This is with Qt 6.5.3 and 6.6.3.

--
Mike Jackson


Hi Mike,

you should be able to reimplement 
https://doc.qt.io/qt-6/qtableview.html#sizeHintForColumn and 
https://doc.qt.io/qt-6/qtableview.html#sizeHintForRow to take the 
https://doc.qt.io/qt-6/qheaderview.html#sectionSizeHint into account.

Cheers,
Volker


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] QTableView Column Width and Headers

2024-05-24 Thread Michael Jackson
I have a question about how the column widths of a QTableView are
calculated? How can I have the QTableView set the column with “to contents”
that includes the QHeader also? For example I have a QHeaderView with the
first “section” that has text “This is a really really really long header”,
but the actual data that is in the QTableView under that header are short
values such as “100” or “2” or “1.231”. When the QTableView is rendered the
the column with is only as wide as the QTableView. It is like the
QHeaderView is not taken into account when calculating the width of the
column.

This is with Qt 6.5.3 and 6.6.3.

--
Mike Jacksonmike.jack...@bluequartz.net
BlueQuartz Software www.bluequartz.net
President/Owner   Dayton, Ohio
Principal DREAM.3D Developer
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest