Skip to content

Commit e146860

Browse files
committed
FIX(a11y): Make AccessibleQGroupBox not read empty table cells
1 parent 2aeb6cb commit e146860

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/mumble/widgets/AccessibleQGroupBox.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ QString AccessibleQGroupBox::textAtPosition(QGridLayout *gridLayout, int y, int
2727
return "";
2828
}
2929

30+
QString accessibleName = label->accessibleName();
31+
if (!accessibleName.isEmpty()) {
32+
return accessibleName;
33+
}
34+
3035
QString content = Mumble::Accessibility::removeHTMLTags(label->text());
3136
if (content.trimmed().isEmpty()) {
3237
content = tr("empty");
@@ -47,11 +52,14 @@ void AccessibleQGroupBox::updateAccessibleText() {
4752
for (int y = tableMode ? 1 : 0; y < gridLayout->rowCount(); y++) {
4853
for (int x = tableMode ? 1 : 0; x < gridLayout->columnCount(); x++) {
4954
if (tableMode) {
50-
text += textAtPosition(gridLayout, y, 0);
51-
text += " ";
52-
text += textAtPosition(gridLayout, 0, x);
53-
text += ", ";
54-
text += textAtPosition(gridLayout, y, x);
55+
QString cellContent = textAtPosition(gridLayout, y, x);
56+
if (!cellContent.isEmpty()) {
57+
text += textAtPosition(gridLayout, y, 0);
58+
text += " ";
59+
text += textAtPosition(gridLayout, 0, x);
60+
text += ", ";
61+
text += cellContent;
62+
}
5563
} else {
5664
text += textAtPosition(gridLayout, y, x);
5765
}

0 commit comments

Comments
 (0)