Skip to content

Fix the disabled list box style after a list selector closes - #805

Merged
suraj-ranganath merged 1 commit into
developfrom
suraj/fix-develop-listdlg-style
Nov 28, 2026
Merged

suraj-ranganath merged 1 commit into
developfrom
suraj/fix-develop-listdlg-style

Conversation

@suraj-ranganath

Copy link
Copy Markdown
Member

The Tests workflow is red on develop at aa81d9a. test_disabled_list_box_is_greyed fails on Ubuntu 3.12 and 3.13, macOS and Windows.

Cause: listdlg2 measured its buttons' size hints before the dialog was polished, so Qt cached the selector's stylesheet rules. When the selector closed without being shown, a new dialog at the same address reused those rules and a disabled list box rendered white.

Fix: Polish the selector right after its stylesheet is applied and before its children are measured. This removes the unpolish workaround in _apply_eeglab_style.

Checks: The full workflow test command with EEGPREP_SKIP_MATLAB=1 passes on Linux with Python 3.12 and 3.13 (3,494 passed, 0 failed, 147 skipped). Pre-commit passes.

This also unblocks #780, #781, #782, #783 and #784, which inherit the same failure from develop.

A child size hint can cache the selector's stylesheet while its parent is still unpolished. If the selector closes without being shown, another dialog can reuse its address and pick up the selector's list colors and sizing. Initialize the styled parent before creating the children so Qt clears its cached rules on destruction.

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Code review skipped — your organization has no extra usage available to pay for this review.

If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.

Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.

@claude

claude Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @suraj-ranganath's task in 43s —— View job


Code review

  • Overall assessment: Looks good. The fix goes after the actual cause and doesn't just hide the symptom. QPushButton.sizeHint() polishes the button, and working out the button's style makes Qt parse and cache the stylesheet of its parent listdlg2 dialog. The dialog itself was never polished, so Qt never connected its destroyed signal to the cache cleanup. A selector that closed without being shown therefore left a stale cache entry behind, keyed by its address. Calling dialog.ensurePolished() right after _apply_listdlg_style (src/eegprep/functions/guifunc/listdlg2.py:126) makes that connection before anything is measured.
  • Highest-risk area: Removing the unpolish guard from _apply_eeglab_style (src/eegprep/functions/guifunc/qt.py:899). Removing it is fine: develop still failed with the guard in place, so it was not protecting anything. Any other unpolished dialog that is measured and then destroyed without being shown would hit the same Qt cache issue. I found no such path in this diff.
  • Merge recommendation: Safe to merge.

Blocking

None.

Important

None.

Nits

None.

Test gaps

None. The existing test_disabled_list_box_is_greyed (tests/test_guifunc_primitives.py:165) is the regression check, and it runs after the listdlg2 tests that build dialogs without showing them.

EEGLAB parity notes

None. Only Qt widget polishing changes. Button sizes, layout and listdlg2.m behaviour are the same as before.

Checked for correctness bugs, EEGLAB parity, data structure compatibility, changed-behavior tests, and CLAUDE.md/AGENTS.md compliance. This PR changes GUI code only, so it does not need the MATLAB reference-suite run.

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.

1 participant