Skip to content

🐛 fix(label_widget): prevent PyQt6 attribute panel crash#1337

Merged
CVHub520 merged 1 commit intoCVHub520:mainfrom
tristanbf:fix/pyqt6-attribute-panel-crash
Apr 18, 2026
Merged

🐛 fix(label_widget): prevent PyQt6 attribute panel crash#1337
CVHub520 merged 1 commit intoCVHub520:mainfrom
tristanbf:fix/pyqt6-attribute-panel-crash

Conversation

@tristanbf
Copy link
Copy Markdown
Contributor

Summary

  • fix the PyQt6 attribute panel crash triggered after loading a shape attributes file
  • switch label width measurement to a Qt6-compatible code path while preserving a legacy fallback
  • add regression coverage for both the horizontalAdvance() path and the fallback path

Test plan

  • ./.venv/Scripts/python.exe -m unittest tests.test_label_widget_metrics
  • manually verified loading label.txt and attribute.json no longer crashes the app

Use QFontMetrics.horizontalAdvance() when available so loading shape attributes no longer crashes on PyQt6, and add regression coverage for both the Qt6 path and the legacy fallback.

Made-with: Cursor
@CVHub520 CVHub520 self-assigned this Apr 7, 2026
@CVHub520 CVHub520 added bug Something isn't working planned labels Apr 7, 2026
@CVHub520 CVHub520 merged commit 441da95 into CVHub520:main Apr 18, 2026
@CVHub520 CVHub520 added fixed and removed planned labels Apr 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working fixed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants