Solution
At first, I suspected that the usage of the rather inefficient QTableWidget class and manually inserting widget items instead of using QTableView would be the culprit, but it turned out to be a totally different problem.
I asked my buddy to make the last few changes to the UI cosmetics and to have a quick look at the slow window loading times. Guess what? The problem didn't even need a profiler. Using the poor man's profiling technique (see Chapter 2, Profiling to Find Bottlenecks, for details), namely, getting a couple of stack traces manually using Process Explorer, the reason for the problem became clear – the resizeToContents() method was being called for the table after each new row had been added. As we can recall from our ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access