Skip to content

[FIX] HeaderView: Do nothing in initStyleOptionForIndex if model is None#7216

Merged
markotoplak merged 1 commit intobiolab:masterfrom
ales-erjavec:fixes/header-view-no-model
Dec 19, 2025
Merged

[FIX] HeaderView: Do nothing in initStyleOptionForIndex if model is None#7216
markotoplak merged 1 commit intobiolab:masterfrom
ales-erjavec:fixes/header-view-no-model

Conversation

@ales-erjavec
Copy link
Contributor

Issue

Fix error in initStyleOptionForIndex:

Traceback (most recent call last):
  File "/Users/aleserjavec/devel/orange3/Orange/widgets/data/owtable.py", line 83, in sectionSizeFromContents
    super().initStyleOptionForIndex(opt, logicalIndex)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/Users/aleserjavec/devel/orange3/Orange/widgets/utils/headerview.py", line 105, in initStyleOptionForIndex
    textAlignment = model.headerData(logicalIndex, self.orientation(),
                    ^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'headerData'

This happens during test tear down with Qt 6.8.2

Description of changes

Do nothing in initStyleOptionForIndex if model is None

Includes
  • Code changes
  • Tests
  • Documentation

@ales-erjavec ales-erjavec force-pushed the fixes/header-view-no-model branch from f9c7417 to 58079c3 Compare December 19, 2025 11:48
@codecov
Copy link

codecov bot commented Dec 19, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.02%. Comparing base (a3a3197) to head (58079c3).
⚠️ Report is 2 commits behind head on master.

❌ Your patch status has failed because the patch coverage (66.66%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7216      +/-   ##
==========================================
- Coverage   89.02%   89.02%   -0.01%     
==========================================
  Files         335      335              
  Lines       74218    74220       +2     
==========================================
- Hits        66076    66074       -2     
- Misses       8142     8146       +4     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@markotoplak markotoplak merged commit 88ec9f0 into biolab:master Dec 19, 2025
42 of 51 checks passed
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