Truthiness of a QHeaderView

Maurizio Berti maurizio.berti at gmail.com
Thu Sep 5 23:15:06 BST 2024


>
>  > QTableView *always* has both a horizontal and vertical header,
>  > so it will never return None for their getter functions.
>
> I can see that in the docs but in my code there is an old comment about
> some headless tests failing.  But its very likely this is somehow
> conflating the length behaviour you mention above.  I'll try to do some
> cleanup.
>

As far as I know, that behavior has existed for more than a decade (I can
confirm it even with the latest PyQt4), and QTableView was never intended
to exist without its headers, since it uses them for many aspects,
including those related to item hints/geometries and the overall viewport
size. Maybe it was different with Qt3 or earlier Qt4, but that's irrelevant
now: QTableView always has and must have two *valid* QHeaderView instances
for both its headers, it always set default ones in its private
constructor, and it's impossible to set any of them to None/null.

Regards,
MaurizioB

-- 
È difficile avere una convinzione precisa quando si parla delle ragioni del
cuore. - "Sostiene Pereira", Antonio Tabucchi
http://www.jidesk.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20240906/92060ba1/attachment.htm>


More information about the PyQt mailing list