qaccessiblebridgeutils.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/platformsupport/accessibility/qaccessiblebridgeutils.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6namespace QAccessibleBridgeUtils {-
7-
8static bool performAction(QAccessibleInterface *iface, const QString &actionName)-
9{-
10 if (QAccessibleActionInterface *actionIface = iface->actionInterface()
QAccessibleAct...ionInterface()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
11 if (actionIface->actionNames().contains(actionName)
actionIface->a...ns(actionName)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
12 actionIface->doAction(actionName);-
13 return
never executed: return true;
true;
never executed: return true;
0
14 }-
15 }
never executed: end of block
0
16 return
never executed: return false;
false;
never executed: return false;
0
17}-
18-
19QStringList effectiveActionNames(QAccessibleInterface *iface)-
20{-
21 QStringList actions;-
22 if (QAccessibleActionInterface *actionIface = iface->actionInterface()
QAccessibleAct...ionInterface()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
23 actions = actionIface->actionNames();
never executed: actions = actionIface->actionNames();
0
24-
25 if (iface->valueInterface()
iface->valueInterface()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
26 if (!actions.contains(QAccessibleActionInterface::increaseAction())
!actions.conta...reaseAction())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
27 actions << QAccessibleActionInterface::increaseAction();
never executed: actions << QAccessibleActionInterface::increaseAction();
0
28 if (!actions.contains(QAccessibleActionInterface::decreaseAction())
!actions.conta...reaseAction())Description
TRUEnever evaluated
FALSEnever evaluated
)
0
29 actions << QAccessibleActionInterface::decreaseAction();
never executed: actions << QAccessibleActionInterface::decreaseAction();
0
30 }
never executed: end of block
0
31 return
never executed: return actions;
actions;
never executed: return actions;
0
32}-
33-
34bool performEffectiveAction(QAccessibleInterface *iface, const QString &actionName)-
35{-
36 if (!iface
!ifaceDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
37 return
never executed: return false;
false;
never executed: return false;
0
38 if (performAction(iface, actionName)
performAction(...e, actionName)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
39 return
never executed: return true;
true;
never executed: return true;
0
40 if (actionName != QAccessibleActionInterface::increaseAction()
actionName != ...creaseAction()Description
TRUEnever evaluated
FALSEnever evaluated
0
41 && actionName != QAccessibleActionInterface::decreaseAction()
actionName != ...creaseAction()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
42 return
never executed: return false;
false;
never executed: return false;
0
43-
44 QAccessibleValueInterface *valueIface = iface->valueInterface();-
45 if (!valueIface
!valueIfaceDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
46 return
never executed: return false;
false;
never executed: return false;
0
47 bool success;-
48 const QVariant currentVariant = valueIface->currentValue();-
49 double stepSize = valueIface->minimumStepSize().toDouble(&success);-
50 if (!success
!successDescription
TRUEnever evaluated
FALSEnever evaluated
|| qFuzzyIsNull(stepSize)
qFuzzyIsNull(stepSize)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
51 const double min = valueIface->minimumValue().toDouble(&success);-
52 if (!success
!successDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
53 return
never executed: return false;
false;
never executed: return false;
0
54 const double max = valueIface->maximumValue().toDouble(&success);-
55 if (!success
!successDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
56 return
never executed: return false;
false;
never executed: return false;
0
57 stepSize = (max - min) / 10;-
58 const int typ = currentVariant.type();-
59 if (typ != QMetaType::Float
typ != QMetaType::FloatDescription
TRUEnever evaluated
FALSEnever evaluated
&& typ != QMetaType::Double
typ != QMetaType::DoubleDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
60-
61 stepSize = qCeil(stepSize);-
62 }
never executed: end of block
0
63 }
never executed: end of block
0
64 const double current = currentVariant.toDouble(&success);-
65 if (!success
!successDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
66 return
never executed: return false;
false;
never executed: return false;
0
67 if (actionName == QAccessibleActionInterface::decreaseAction()
actionName == ...creaseAction()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
68 stepSize = -stepSize;
never executed: stepSize = -stepSize;
0
69 valueIface->setCurrentValue(current + stepSize);-
70 return
never executed: return true;
true;
never executed: return true;
0
71}-
72-
73}-
74-
75-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9