Repository navigation
Per-row dataChanged invalidation and PreparedRow.wraps in MultilinePreviewItemDelegate - #81
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
prepare_rowcalls on a 124-rowQTreeWidgetwith 1 row updating per frame (60 frames × 12 visible rows, alternating unprofiled A/B): median52.73 ms→23.55 ms,prepare_row720→12.dataChangedinvalidation (src/pyqt_reactive/widgets/shared/list_item_delegate.py):MultilinePreviewItemDelegate._followpreviously connectedmodel.dataChangedtoforget_rows, wiping every cachedPreparedRow(and subclass per-row image caches like Toad'sQtNameWaveDelegate._row_images) whenever any single row updated. Addedforget_range(top_left, bottom_right, *_roles)and_rows_forgotten(rows)hook so single-row and bounded multi-rowdataChangedevents drop only modified(row, col, internalId)entries (withforget_rowsfallback on invalid, cross-parent, or oversized ranges, andKEPT_ROWSeviction callingforget_rows()so subclasses stay consistent).PreparedRow.wraps(view)and replaced the three repeatedview.wordWrap() if row.wrap_mode is None else row.wrap_mode.wrappedchecks inpaint,_row_wraps, and_prepared_text.Verification
QT_QPA_PLATFORM=offscreen pytest -q -p no:xdist --no-cov tests/test_list_preview_wrapping.py:28 passed in 0.45s(includes newtest_data_changed_invalidates_only_modified_rows_in_list_and_treecovering bothQListWidgetand nestedQTreeWidgetrows).REL_IMPORTS=0.