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
// Qt-Security score:significant reason:default
4
5
#
include
"qaccessiblequickpage_p.h"
6
#
include
"qquickpage_p.h"
7
8
QT_BEGIN_NAMESPACE
9
10
QAccessibleQuickPage
::
QAccessibleQuickPage
(
QQuickPage
*
page
)
11
:
QAccessibleQuickControl
(page)
12
{
13
}
14
15
QAccessibleInterface *QAccessibleQuickPage::child(
int
index)
const
16
{
17
const
QList<QQuickItem*> kids = orderedChildItems();
18
if
(QQuickItem *item = kids.value(index))
19
return
QAccessible::queryAccessibleInterface(item);
20
return
nullptr
;
21
}
22
23
int
QAccessibleQuickPage
::
indexOfChild
(
const
QAccessibleInterface *iface)
const
24
{
25
const
QList<QQuickItem*> kids = orderedChildItems();
26
return
(
int
)kids.indexOf(
static_cast
<QQuickItem*>(iface->object()));
27
}
28
29
QList<QQuickItem *>
QAccessibleQuickPage
::orderedChildItems()
const
30
{
31
// Just ensures that the header is first, and footer is last. Other existing order is kept.
32
const
QQuickPage *p = page();
33
QList<QQuickItem*> kids = childItems();
34
const
qsizetype hidx = kids.indexOf(p->header());
35
if
(hidx != -1)
36
kids.move(hidx, 0);
37
const
qsizetype fidx = kids.indexOf(p->footer());
38
if
(fidx != -1)
39
kids.move(fidx, kids.size() - 1);
40
return
kids;
41
}
42
43
QQuickPage *
QAccessibleQuickPage
::page()
const
44
{
45
return
static_cast
<QQuickPage*>(object());
46
}
47
48
QT_END_NAMESPACE
QAccessibleQuickControl
Definition
qaccessiblequickcontrol_p.h:26
QAccessibleQuickPage
Definition
qaccessiblequickpage_p.h:26
QAccessibleQuickPage::indexOfChild
int indexOfChild(const QAccessibleInterface *iface) const override
Definition
qaccessiblequickpage.cpp:23
QQuickPage
Definition
qquickpage_p.h:27
QPlatformGraphicsBufferHelper
\inmodule QtGui
qtdeclarative
src
quicktemplates
accessible
qaccessiblequickpage.cpp
Generated on
for Qt by
1.14.0