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
qaccessibilityhints.cpp
Go to the documentation of this file.
1// Copyright (C) 2025 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
7
9
10void QAccessibilityHintsPrivate::updateContrastPreference(Qt::ContrastPreference contrastPreference)
11{
12 if (m_contrastPreference == contrastPreference)
13 return;
14 m_contrastPreference = contrastPreference;
15
16 Q_Q(QAccessibilityHints);
17 emit q->contrastPreferenceChanged(contrastPreference);
18}
19
20void QAccessibilityHintsPrivate::updateMotionPreference(Qt::MotionPreference motionPreference)
21{
22 if (m_motionPreference == motionPreference)
23 return;
24 m_motionPreference = motionPreference;
25
26 Q_Q(QAccessibilityHints);
27 emit q->motionPreferenceChanged(motionPreference);
28}
29
31{
32 Q_ASSERT(q);
33 return q->d_func();
34}
35
36/*!
37 \class QAccessibilityHints
38 \since 6.10
39 \brief The QAccessibilityHints class contains platform specific accessibility hints and settings.
40 \inmodule QtGui
41
42 This class bundles together platform specific accessibility settings, and can be accessed from
43 \l QStyleHints::accessibility.
44
45 \sa QStyleHints
46*/
47
48QAccessibilityHints::QAccessibilityHints(QObject *parent)
49 : QObject(*(new QAccessibilityHintsPrivate), parent)
50{}
51
52QAccessibilityHints::~QAccessibilityHints() = default;
53
54/*!
55 \property QAccessibilityHints::contrastPreference
56 \brief The contrast mode set by the system.
57
58 This property can be used by the application to determine what contrast settings the system
59 is currently using.
60
61 Qt styles use this property in order to adjust palette colors and outlines.
62
63 \sa Qt::ColorScheme, QGuiApplication::palette(), QEvent::PaletteChange
64 \since 6.10
65*/
66Qt::ContrastPreference QAccessibilityHints::contrastPreference() const
67{
68 Q_D(const QAccessibilityHints);
69 return d->m_contrastPreference;
70}
71
72/*!
73 \property QAccessibilityHints::motionPreference
74 \brief The motion preference set by the system.
75
76 This property can be used by the application to determine if the user interface should have
77 fewer animated effects. Respecting this preference may make the application more accessible
78 to those that suffer from vestibular motion disorders.
79
80 \sa contrastPreference
81 \since 6.12
82*/
83Qt::MotionPreference QAccessibilityHints::motionPreference() const
84{
85 Q_D(const QAccessibilityHints);
86 return d->m_motionPreference;
87}
88
89/*!
90 \reimp
91*/
92bool QAccessibilityHints::event(QEvent *event)
93{
94 return QObject::event(event);
95}
96
97QT_END_NAMESPACE
98
99#include "moc_qaccessibilityhints.cpp"
void updateMotionPreference(Qt::MotionPreference motionPreference)
Combined button and popup list for selecting options.