Use PyQt6 item data roles in log viewer - #5
Merged
Conversation
This was referenced Aug 1, 2026
trissim
marked this pull request as ready for review
August 1, 2026 17:02
There was a problem hiding this comment.
Pull request overview
This PR completes the PyQt6 migration in the log viewer by replacing the remaining legacy Qt.DisplayRole usages with the scoped Qt.ItemDataRole.DisplayRole, and adds a regression test to exercise both search-match precomputation and delegate sizing under PyQt6.
Changes:
- Updated
LogItemDelegateto useQt.ItemDataRole.DisplayRolewhen reading model text for search precomputation. - Updated
LogItemDelegate.sizeHint()to useQt.ItemDataRole.DisplayRolewhen sizing rows. - Added a PyQt6-focused lifecycle test that executes
_precompute_search_matches()andsizeHint()and asserts expected behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
tests/test_log_viewer_lifecycle.py |
Adds a regression test to exercise delegate search precomputation + sizing with PyQt6-scoped item data roles. |
src/pyqt_reactive/widgets/log_viewer.py |
Replaces the remaining Qt.DisplayRole accesses with Qt.ItemDataRole.DisplayRole in the log viewer delegate logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
What changed
Qt.DisplayRoleaccesses in the log viewer withQt.ItemDataRole.DisplayRoleThis is the declaration-owner fix for OpenHCS issue #61; no OpenHCS-side compatibility shim is introduced.
Verification