6#if QT_CONFIG(accessibility)
18#if QT_CONFIG(whatsthis)
24#if QT_CONFIG(rubberband)
31#include <QtWidgets/private/qwidget_p.h>
46#if QT_CONFIG(shortcut) && QT_CONFIG(label)
54#if QT_CONFIG(groupbox)
57 return groupbox->
title();
98 qsizetype ampIndex = qt_accAmpIndex(newText);
100 newText.remove(ampIndex, 1);
102 return newText.replace(
"&&"_L1,
"&"_L1);
107#ifndef QT_NO_SHORTCUT
119class QAccessibleWidgetPrivate
122 QAccessibleWidgetPrivate()
126 QAccessible::Role role;
159QAccessibleWidget::QAccessibleWidget(
QWidget *
w, QAccessible::Role role,
const QString &
name)
160: QAccessibleObject(
w)
163 d =
new QAccessibleWidgetPrivate();
169bool QAccessibleWidget::isValid()
const
171 if (!
object() ||
static_cast<QWidget *
>(
object())->d_func()->
data.in_destructor)
173 return QAccessibleObject::isValid();
177QWindow *QAccessibleWidget::window()
const
184 result = nativeParent->windowHandle();
192QAccessibleWidget::~QAccessibleWidget()
200QWidget *QAccessibleWidget::widget()
const
209QObject *QAccessibleWidget::parentObject()
const
212 if (!
w ||
w->isWindow() || !
w->parentWidget())
218QRect QAccessibleWidget::rect()
const
225 return QRect(wpos.
x(), wpos.
y(),
w->width(),
w->height());
234void QAccessibleWidget::addControllingSignal(
const QString &
signal)
238 qWarning(
"Signal %s unknown in %s",
s.constData(),
object()->metaObject()->className());
254QAccessibleWidget::relations(QAccessible::Relation
match )
const
257 if (
match & QAccessible::Label) {
258 const QAccessible::Relation rel = QAccessible::Label;
260#if QT_CONFIG(shortcut) && QT_CONFIG(label)
266 if (
QLabel *labelSibling = qobject_cast<QLabel*>(kid)) {
267 if (labelSibling->buddy() ==
widget()) {
268 QAccessibleInterface *
iface = QAccessible::queryAccessibleInterface(labelSibling);
274#if QT_CONFIG(groupbox)
277 QAccessibleInterface *
iface = QAccessible::queryAccessibleInterface(groupbox);
284 if (
match & QAccessible::Controlled) {
287 for (
int sig = 0; sig <
d->primarySignals.size(); ++sig) {
288 const QObjectList receivers = connectionObject->d_func()->receiverList(
d->primarySignals.at(sig).toLatin1());
289 allReceivers += receivers;
294 for (
int i = 0;
i < allReceivers.
size(); ++
i) {
295 const QAccessible::Relation rel = QAccessible::Controlled;
296 QAccessibleInterface *
iface = QAccessible::queryAccessibleInterface(allReceivers.
at(
i));
306QAccessibleInterface *QAccessibleWidget::parent()
const
308 return QAccessible::queryAccessibleInterface(parentObject());
312QAccessibleInterface *QAccessibleWidget::child(
int index)
const
317 return QAccessible::queryAccessibleInterface(childList.
at(
index));
322QAccessibleInterface *QAccessibleWidget::focusChild()
const
325 return QAccessible::queryAccessibleInterface(
object());
331 if (isAncestor(
widget(), fw)) {
332 QAccessibleInterface *
iface = QAccessible::queryAccessibleInterface(fw);
333 if (!iface || iface ==
this || !
iface->focusChild())
335 return iface->focusChild();
341int QAccessibleWidget::childCount()
const
348int QAccessibleWidget::indexOfChild(
const QAccessibleInterface *
child)
const
360QString QAccessibleWidget::text(QAccessible::Text
t)
const
365 case QAccessible::Name:
366 if (!
d->name.isEmpty()) {
368 }
else if (!
widget()->accessibleName().isEmpty()) {
371 if (
widget()->isMinimized())
376 str = qt_accStripAmp(buddyString(
widget()));
379 case QAccessible::Description:
381#if QT_CONFIG(tooltip)
386 case QAccessible::Help:
387#if QT_CONFIG(whatsthis)
391 case QAccessible::Accelerator:
392 str = qt_accHotKey(buddyString(
widget()));
394 case QAccessible::Value:
408 names << setFocusAction();
414void QAccessibleWidget::doAction(
const QString &actionName)
419 if (actionName == setFocusAction()) {
433QAccessible::Role QAccessibleWidget::role()
const
445 state.invisible =
true;
447 state.focusable =
true;
449 state.focused =
true;
451 state.disabled =
true;
454 state.movable =
true;
455 if (
w->minimumSize() !=
w->maximumSize())
456 state.sizeable =
true;
457 if (
w->isActiveWindow())
465QColor QAccessibleWidget::foregroundColor()
const
471QColor QAccessibleWidget::backgroundColor()
const
477void *QAccessibleWidget::interface_cast(QAccessible::InterfaceType
t)
479 if (
t == QAccessible::ActionInterface)
480 return static_cast<QAccessibleActionInterface*
>(
this);
The QAccessible class provides enums and static functions related to accessibility.
The QColor class provides colors based on RGB, HSV or CMYK values.
The QGroupBox widget provides a group box frame with a title.
QString title
the group box title text
The QKeySequence class encapsulates a key sequence as used by shortcuts.
QString toString(SequenceFormat format=PortableText) const
The QLabel widget provides a text or image display.
qsizetype size() const noexcept
const_reference at(qsizetype i) const noexcept
qsizetype removeAll(const AT &t)
void append(parameter_type t)
const QColor & color(ColorGroup cg, ColorRole cr) const
Returns the color in the specified color group, used for the given color role.
\inmodule QtCore\reentrant
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr int y() const noexcept
Returns the y coordinate of this point.
\inmodule QtCore\reentrant
\macro QT_RESTRICTED_CAST_FROM_ASCII
qsizetype size() const
Returns the number of characters in this string.
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static QString static QString qsizetype indexOf(QChar c, qsizetype from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Combined button and popup list for selecting options.
constexpr QBindableInterface iface
GLfloat GLfloat GLfloat w
[0]
GLuint GLsizei const GLchar * label
[43]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
constexpr decltype(auto) qMakePair(T1 &&value1, T2 &&value2) noexcept(noexcept(std::make_pair(std::forward< T1 >(value1), std::forward< T2 >(value2))))
static bool isWindow(QObject *object)
static bool match(const uchar *found, uint foundLen, const char *target, uint targetLen)
static QT_BEGIN_NAMESPACE QString windowTitle(HWND hwnd)
obj metaObject() -> className()
qsizetype indexOf(const AT &t, qsizetype from=0) const noexcept
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent