[PyQt] [pyqt]Low speed of qtablewidget.resizeRowsToContents

Florian Bruhin me at the-compiler.org
Sun Jul 15 16:00:07 BST 2018


On Sun, Jul 15, 2018 at 07:14:06PM +0430, Maziar Parsijani wrote:
>  Hi
> I  have some data in file.xlsx and I read from it. When I use
> resizerowstocontents for text data(for example more than 50 rows)
> the operation is getting slower when the more rows added.

That seems expected. To resize the row to the longest content, Qt will
have to calculate the size needed for every item.

It seems like you can use QHeaderView::setResizeContentsPrecision to
tell it to look at less items though:

https://doc.qt.io/qt-5/qheaderview.html#setResizeContentsPrecision

Florian

-- 
https://www.qutebrowser.org | me at the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc
         I love long mails! | https://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20180715/8ce6bba0/attachment-0001.sig>


More information about the PyQt mailing list