25 if (QAccessibleActionInterface *actionIface = iface->actionInterface())
26 actions = actionIface->actionNames();
28 if (iface->valueInterface()) {
29 if (!actions.contains(QAccessibleActionInterface::increaseAction()))
30 actions << QAccessibleActionInterface::increaseAction();
31 if (!actions.contains(QAccessibleActionInterface::decreaseAction()))
32 actions << QAccessibleActionInterface::decreaseAction();
41 if (performAction(iface, actionName))
43 if (actionName != QAccessibleActionInterface::increaseAction()
44 && actionName != QAccessibleActionInterface::decreaseAction())
47 QAccessibleValueInterface *valueIface = iface->valueInterface();
51 const QVariant currentVariant = valueIface->currentValue();
52 double stepSize = valueIface->minimumStepSize().toDouble(&success);
53 if (!success || qFuzzyIsNull(stepSize)) {
54 const double min = valueIface->minimumValue().toDouble(&success);
57 const double max = valueIface->maximumValue().toDouble(&success);
60 stepSize = (max - min) / 10;
61 const int typ = currentVariant.userType();
62 if (typ != QMetaType::Float && typ != QMetaType::Double) {
64 stepSize = qCeil(stepSize);
67 const double current = currentVariant.toDouble(&success);
70 if (actionName == QAccessibleActionInterface::decreaseAction())
72 valueIface->setCurrentValue(current + stepSize);
80 result = accessible->text(QAccessible::Identifier);
81 if (!result.isEmpty())
84 if (!result.isEmpty())
86 if (
auto obj = accessible->object()) {
87 const QString name = obj->objectName();
91 result.prepend(QString::fromUtf8(obj->metaObject()->className()));
93 accessible = accessible->parent();
130 const QAccessibleInterface *ancestorInterface,
131 QWindow *ancestorWindow)
133 Q_ASSERT(
bool(ancestorInterface) ==
bool(ancestorWindow));
135 for (
const auto *candidate = iface; candidate && candidate != ancestorInterface;
136 candidate = candidate->parent()) {
137 QWindow *window = candidate->window();
144 if (ancestorWindow && window->isAncestorOf(ancestorWindow, QWindow::ExcludeTransients))
150 return ancestorWindow;