diff --git a/app/playlists.py b/app/playlists.py index a8b8a26..e5118f9 100644 --- a/app/playlists.py +++ b/app/playlists.py @@ -726,7 +726,19 @@ class PlaylistTab(QTableView): if playlist_id != self.playlist_id: return - self.resizeRowsToContents() + # self.resizeRowsToContents() + # Suggestion from phind.com + def resize_row(row, count=1): + row_count = self.source_model.rowCount() + for todo in range(count): + if row < row_count: + self.resizeRowToContents(row) + row += 1 + if row < row_count: + QTimer.singleShot(0, lambda: resize_row(row, count)) + + # Start resizing from row 0, 10 rows at a time + QTimer.singleShot(0, lambda: resize_row(0, 10)) def scroll_to_top(self, row_number: int) -> None: """