Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qaccessiblequickspinbox.cpp
Go to the documentation of this file.
1// Copyright (C) 2026 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
8
10
15
16void QAccessibleQuickSpinBox::doAction(const QString &actionName)
17{
18 const bool increase = actionName == QAccessibleActionInterface::increaseAction();
19 const bool decrease = actionName == QAccessibleActionInterface::decreaseAction();
20 if (!increase && !decrease) {
21 QAccessibleQuickControl::doAction(actionName);
22 return;
23 }
24 if (doAttachedAction(actionName))
25 return;
26 if (auto *spinBox = qobject_cast<QQuickSpinBox *>(object())) {
27 if (increase)
28 spinBox->accessibilityIncrease();
29 else
30 spinBox->accessibilityDecrease();
31 } else if (auto *doubleSpinBox = qobject_cast<QQuickDoubleSpinBox *>(object())) {
32 if (increase)
33 doubleSpinBox->accessibilityIncrease();
34 else
35 doubleSpinBox->accessibilityDecrease();
36 }
37}
38
39void QAccessibleQuickSpinBox::setCurrentValue(const QVariant &value)
40{
41 if (auto *spinBox = qobject_cast<QQuickSpinBox *>(object()))
42 spinBox->accessibilitySetValue(qRound(value.toDouble()));
43 else if (auto *doubleSpinBox = qobject_cast<QQuickDoubleSpinBox *>(object()))
44 doubleSpinBox->accessibilitySetValue(value.toDouble());
45}
46
47QT_END_NAMESPACE
void setCurrentValue(const QVariant &value) override
void doAction(const QString &actionName) override
Combined button and popup list for selecting options.
QSpinBox * spinBox
[0]