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
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
47QT_END_NAMESPACE
int indexOfChild(const QAccessibleInterface *iface) const override
Combined button and popup list for selecting options.
QByteArray page
[45]