[Qt] Make colorimeter correction web-check dialog columns sortable - #959
Merged
eoyilmaz merged 1 commit intoJul 28, 2026
Merged
Conversation
_WebCheckChooserDialog now enables QTableWidget sorting, and sorts the ΔE*00 avg/max columns numerically instead of lexicographically via a custom QTableWidgetItem.__lt__(). The row-lookup in accept() previously indexed the original rows list by visual row position, which would have returned the wrong row once sorting reorders the table, so it now reads the row dict back from the item itself.
eoyilmaz
deleted the
958-qt-colorimeter-correction-dialog-columns-not-sortable
branch
July 28, 2026 17:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_WebCheckChooserDialog'sQTableWidgetnow hassetSortingEnabled(True), so clicking a column header sorts ascending/descending as usual._NumericTableWidgetItemsubclass overriding__lt__()to compare asfloat(falling back to text comparison for non-numeric placeholders like "Not applicable").accept()picked the selected row's data by indexing the originalrowslist with the table's visual row number, which is wrong once sorting reorders rows. Each row's source dict is now stashed on its first-column item viaQt.UserRoleand read back from the table, independent of sort order.RecursionErrorfound while testing: the numeric item's non-numeric fallback originally calledsuper().__lt__(other), but PySide's vtable slot for that virtual still resolves back to the Python override regardless ofsuper(), so it recursed infinitely on any pairing involving a non-numeric ΔE*00 value (e.g. CCSS entries showing "Not applicable"). Replaced with a direct text comparison.colorimeter_correction_web_check_chooseindisplay_cal.py), which uses a plain, unsortedwx.ListCtrl, so this is a net-new Qt enhancement rather than a parity fix.Test plan
pytest tests/test_ui_colorimeter_correction_io.py— 19/20 pass (one pre-existing, unrelatedImportControllerfailure present ondeveloptoo)super().__lt__())ruff check DisplayCAL/ui/colorimeter_correction_io.pyclean