Make checkboxes less verbose.

This commit is contained in:
Storm Dragon committed 2026-09-16 00:57:53 -04:00
1 parent f39ec4d51a
commit eb63cfe8bf
3 files changed
+8 -11

No files matched your search

+5 -4
View File
@@ -226,11 +226,12 @@ def test_checkbox_cell_exposes_checked_state_and_accessible_text(window):
w.libraryBrowser.checkedStateAnnouncement.connect(announcements.append)
assert page.model.headerData(0, Qt.Horizontal) == 'Selected'
assert page.model.data(checkboxIndex, Qt.AccessibleTextRole) == 'Select Artist, unchecked'
assert page.model.data(checkboxIndex, Qt.AccessibleTextRole) == 'Artist, unchecked'
assert page.model.data(checkboxIndex, Qt.AccessibleDescriptionRole) is None
assert page.model.flags(checkboxIndex) & Qt.ItemIsUserCheckable
interface = QAccessible.queryAccessibleInterface(page.table)
checkbox = next(interface.child(i) for i in range(interface.childCount())
if interface.child(i).text(QAccessible.Name) == 'Select Artist, unchecked')
if interface.child(i).text(QAccessible.Name) == 'Artist, unchecked')
assert checkbox.state().checkable
assert not checkbox.state().checked
@@ -238,11 +239,11 @@ def test_checkbox_cell_exposes_checked_state_and_accessible_text(window):
QApplication.processEvents()
assert page.model.data(checkboxIndex, Qt.CheckStateRole) == Qt.Checked
assert page.model.data(checkboxIndex, Qt.AccessibleTextRole) == 'Select Artist, checked'
assert page.model.data(checkboxIndex, Qt.AccessibleTextRole) == 'Artist, checked'
assert announcements == ['Artist checked; 1 item checked.']
interface = QAccessible.queryAccessibleInterface(page.table)
checkbox = next(interface.child(i) for i in range(interface.childCount())
if interface.child(i).text(QAccessible.Name) == 'Select Artist, checked')
if interface.child(i).text(QAccessible.Name) == 'Artist, checked')
assert checkbox.state().checkable
assert checkbox.state().checked