Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qaccessiblequickpage.cpp
Go to the documentation of this file.
1// Copyright (C) 2021 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
5#include "qquickpage_p.h"
6
8
13
14QAccessibleInterface *QAccessibleQuickPage::child(int index) const
15{
16 const QList<QQuickItem*> kids = orderedChildItems();
17 if (QQuickItem *item = kids.value(index))
18 return QAccessible::queryAccessibleInterface(item);
19 return nullptr;
20}
21
22int QAccessibleQuickPage::indexOfChild(const QAccessibleInterface *iface) const
23{
24 const QList<QQuickItem*> kids = orderedChildItems();
25 return (int)kids.indexOf(static_cast<QQuickItem*>(iface->object()));
26}
27
28QList<QQuickItem *> QAccessibleQuickPage::orderedChildItems() const
29{
30 // Just ensures that the header is first, and footer is last. Other existing order is kept.
31 const QQuickPage *p = page();
32 QList<QQuickItem*> kids = childItems();
33 const qsizetype hidx = kids.indexOf(p->header());
34 if (hidx != -1)
35 kids.move(hidx, 0);
36 const qsizetype fidx = kids.indexOf(p->footer());
37 if (fidx != -1)
38 kids.move(fidx, kids.size() - 1);
39 return kids;
40}
41
42QQuickPage *QAccessibleQuickPage::page() const
43{
44 return static_cast<QQuickPage*>(object());
45}
46
48
QAccessibleQuickPage(QQuickPage *page)
int indexOfChild(const QAccessibleInterface *iface) const override
QAccessibleInterface * child(int index) const override
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
Combined button and popup list for selecting options.
GLuint index
[2]
GLuint object
[3]
GLfloat GLfloat p
[1]
ptrdiff_t qsizetype
Definition qtypes.h:165
QByteArray page
[45]
QGraphicsItem * item