Skip to content

Use PyQt6 item data roles in log viewer - #5

Merged
trissim merged 1 commit into
mainfrom
agent/pyqt6-item-data-role
Aug 1, 2026
Merged

Use PyQt6 item data roles in log viewer#5
trissim merged 1 commit into
mainfrom
agent/pyqt6-item-data-role

Conversation

@trissim

@trissim trissim commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

What changed

  • replace the two remaining legacy Qt.DisplayRole accesses in the log viewer with Qt.ItemDataRole.DisplayRole
  • exercise both search precomputation and delegate sizing under PyQt6

This is the declaration-owner fix for OpenHCS issue #61; no OpenHCS-side compatibility shim is introduced.

Verification

PYTHONPATH=src:../ObjectState/src:../python-introspect/src QT_QPA_PLATFORM=offscreen ../../.venv/bin/python -m pytest tests/test_log_viewer_lifecycle.py -q
5 passed

@trissim
trissim marked this pull request as ready for review August 1, 2026 17:02
Copilot AI review requested due to automatic review settings August 1, 2026 17:02
@trissim
trissim merged commit 0911822 into main Aug 1, 2026
11 checks passed
@trissim
trissim deleted the agent/pyqt6-item-data-role branch August 1, 2026 17:02

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep Code Review Agent🐛

Review completed with 0 suggestions.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 LogItemDelegate to use Qt.ItemDataRole.DisplayRole when reading model text for search precomputation.
  • Updated LogItemDelegate.sizeHint() to use Qt.ItemDataRole.DisplayRole when sizing rows.
  • Added a PyQt6-focused lifecycle test that executes _precompute_search_matches() and sizeHint() 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants