You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test_window_without_a_height_is_as_high_as_its_rows fails on Windows (57 vs 56) #834
tests/test_guifunc_primitives.py::test_window_without_a_height_is_as_high_as_its_rows fails on windows-latest (Python 3.12) with assert [57, 28] == [56, 28]: the computed window height is one pixel taller than expected. It came in with #776 ("Size a dialog from its rows, one row height per platform") and showed up on #832 after that PR merged develop, twice in a row (run 46188267231 and its rerun). #832 changes only the ASR reconstruction (riemann.py, its test and the changelog), so the failure is independent of it.
Likely a Windows font-metric or DPI rounding difference in the per-platform row height; the expected value may need a one-pixel tolerance on Windows or a platform-specific constant.
Agentic AI tools were used. Workflows follow the Research Skills (doi:10.5281/zenodo.20696515). The author assumes full responsibility for this content and associated changes.
Qt layouts size a widget by max(sizeHint, minimumSizeHint) (QWidgetItem::sizeHint), but _row_height measures only sizeHint(). QLineEdit.minimumSizeHint() adds max(2, fm.leading()) where sizeHint() adds 2, so a font with leading > 2 (Segoe UI on Windows) gives an edit box one pixel taller in the layout than the row height assumes. That one row is then 25 px instead of 24, hence 57 vs 56.
Measure the probes (and the test edit box) as the layout does: sizeHint().expandedTo(minimumSizeHint()). This is a product fix: every row then gets the height the edit row actually takes. It does not add a test tolerance. Qt cannot run in this sandbox (no libEGL), so the windows-latest CI job on the PR is the verification.
Activity
claude commentedon Nov 28, 2026
🤖 Plan:
Test Python 3.12 on windows-latestpassesResearch
Qt layouts size a widget by
max(sizeHint, minimumSizeHint)(QWidgetItem::sizeHint), but_row_heightmeasures onlysizeHint().QLineEdit.minimumSizeHint()addsmax(2, fm.leading())wheresizeHint()adds 2, so a font with leading > 2 (Segoe UI on Windows) gives an edit box one pixel taller in the layout than the row height assumes. That one row is then 25 px instead of 24, hence 57 vs 56.Relevant code
src/eegprep/functions/guifunc/qt.py#L952-L966- row height from probesizeHint()onlytests/test_guifunc_primitives.py#L289-L314- failing test, samesizeHint()measureProposed Fix
Measure the probes (and the test edit box) as the layout does:
sizeHint().expandedTo(minimumSizeHint()). This is a product fix: every row then gets the height the edit row actually takes. It does not add a test tolerance. Qt cannot run in this sandbox (no libEGL), so the windows-latest CI job on the PR is the verification.