Python Forum
[PyQt] Determine whether text in QTableView cell is fully visible or not - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: GUI (https://python-forum.io/forum-10.html)
+--- Thread: [PyQt] Determine whether text in QTableView cell is fully visible or not (/thread-38551.html)



Determine whether text in QTableView cell is fully visible or not - random_nick - Oct-27-2022

Hi!

I need to implement a feature for QTableView which many spreadsheet programs have. For example, LibreOffice Calc shows an arrow for a cell if text within this cell cannot be made fully visible without resizing it.

I know about sizeHint method, however calculating a height for each cell takes about the same time as resizing the table by contents, i.e. it is very slow (my program which needs to show 400x10 table becomes about 5 times slower).

So, if there is a fast method to tell if text fully fits the cell?