Changeset View
Changeset View
Standalone View
Standalone View
examples/accessibleapps/accessibleproperties.cpp
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Line(s) | 79 | { | |||
---|---|---|---|---|---|
93 | if (interfaces.testFlag(QAccessibleClient::AccessibleObject::AccessibleInterface)) { | 93 | if (interfaces.testFlag(QAccessibleClient::AccessibleObject::AccessibleInterface)) { | ||
94 | QStandardItem *item = append(QString("Accessible")); | 94 | QStandardItem *item = append(QString("Accessible")); | ||
95 | append(QString("Name"), acc.name(), item); | 95 | append(QString("Name"), acc.name(), item); | ||
96 | append(QString("Description"), acc.description(), item); | 96 | append(QString("Description"), acc.description(), item); | ||
97 | append(QString("Role"), acc.roleName(), item); | 97 | append(QString("Role"), acc.roleName(), item); | ||
98 | append(QString("LocalizedRole"), acc.localizedRoleName(), item); | 98 | append(QString("LocalizedRole"), acc.localizedRoleName(), item); | ||
99 | append(QString("Visible"), acc.isVisible(), item); | 99 | append(QString("Visible"), acc.isVisible(), item); | ||
100 | append(QString("Default"), acc.isDefault(), item); | 100 | append(QString("Default"), acc.isDefault(), item); | ||
101 | append(QString("State"), stateString(acc), item); | 101 | append(QString("State"), acc.stateString(), item); | ||
102 | append(tr("Url"), acc.url(), item); | 102 | append(tr("Url"), acc.url(), item); | ||
103 | AccessibleObject parent = acc.parent(); | 103 | AccessibleObject parent = acc.parent(); | ||
104 | if (parent.isValid()) | 104 | if (parent.isValid()) | ||
105 | append(tr("Parent"), parent.url(), item); | 105 | append(tr("Parent"), parent.url(), item); | ||
106 | int childCount = acc.childCount(); | 106 | int childCount = acc.childCount(); | ||
107 | QStandardItem *children = append(QString("Children"), acc.childCount(), item); | 107 | QStandardItem *children = append(QString("Children"), acc.childCount(), item); | ||
108 | for (int i = 0; i < childCount; ++i) { | 108 | for (int i = 0; i < childCount; ++i) { | ||
109 | AccessibleObject child = acc.child(i); | 109 | AccessibleObject child = acc.child(i); | ||
▲ Show 20 Lines • Show All 240 Lines • ▼ Show 20 Line(s) | 349 | if (changeHandler) { | |||
350 | *changeHandler = valueItem; | 350 | *changeHandler = valueItem; | ||
351 | valueItem->setEditable(true); | 351 | valueItem->setEditable(true); | ||
352 | } else { | 352 | } else { | ||
353 | valueItem->setEditable(false); | 353 | valueItem->setEditable(false); | ||
354 | } | 354 | } | ||
355 | 355 | | |||
356 | return nameItem; | 356 | return nameItem; | ||
357 | } | 357 | } | ||
358 | | ||||
359 | QString ObjectProperties::stateString(const QAccessibleClient::AccessibleObject &acc) | | |||
360 | { | | |||
361 | QStringList s; | | |||
362 | if (acc.isActive()) s << "Active"; | | |||
363 | if (acc.isCheckable()) s << "Checkable"; | | |||
364 | if (acc.isChecked()) s << "Checked"; | | |||
365 | if (acc.isEditable()) s << "Editable"; | | |||
366 | if (acc.isExpandable()) s << "Expandable"; | | |||
367 | if (acc.isExpanded()) s << "Expanded"; | | |||
368 | if (acc.isFocusable()) s << "Focusable"; | | |||
369 | if (acc.isFocused()) s << "Focused"; | | |||
370 | if (acc.isMultiLine()) s << "MultiLine"; | | |||
371 | if (acc.isSelectable()) s << "Selectable"; | | |||
372 | if (acc.isSelected()) s << "Selected"; | | |||
373 | if (acc.isSensitive()) s << "Sensitive"; | | |||
374 | if (acc.isSingleLine()) s << "SingleLine"; | | |||
375 | return s.join(","); | | |||
376 | } | |