Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qaccessiblecache_mac.mm
Go to the documentation of this file.
1
// Copyright (C) 2016 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
4
#
include
"qaccessiblecache_p.h"
5
#
include
<
QtCore
/
private
/
qcore_mac_p
.
h
>
6
7
// qcocoaaccessibilityelement.h in platform plugin
8
QT_DECLARE_NAMESPACED_OBJC_INTERFACE
(QMacAccessibilityElement, NSObject
9
- (
void
)invalidate;
10
)
11
12
QT_BEGIN_NAMESPACE
13
14
bool
QAccessibleCache::insertElement(QAccessible::Id axid,
15
QT_MANGLE_NAMESPACE(QMacAccessibilityElement) *element)
const
16
{
17
auto
*oldElement = accessibleElements.value(axid);
18
if
(oldElement == element)
19
return
false
;
20
21
// Update the map before invalidating and releasing the old element, as
22
// that might re-enter the cache.
23
[element retain];
24
accessibleElements.insert(axid, element);
25
if
(oldElement) {
26
[oldElement invalidate];
27
[oldElement release];
28
}
29
return
true
;
30
}
31
32
void
QAccessibleCache::removeAccessibleElement(QAccessible::Id axid)
33
{
34
// Some QAccessibleInterface instances in the cache didn't get created in
35
// response to a query, but when we emit events. So we might get called with
36
// and axid for which we don't have any element (yet).
37
// Remove the element from the map before invalidating and releasing it,
38
// as that might re-enter the cache.
39
if
(QT_MANGLE_NAMESPACE(QMacAccessibilityElement) *element = accessibleElements.take(axid)) {
40
[element invalidate];
41
[element release];
42
}
43
}
44
45
QT_MANGLE_NAMESPACE(QMacAccessibilityElement) *QAccessibleCache::elementForId(QAccessible::Id axid)
const
46
{
47
return
accessibleElements.value(axid);
48
}
49
50
QT_END_NAMESPACE
QT_DECLARE_NAMESPACED_OBJC_INTERFACE
QT_DECLARE_NAMESPACED_OBJC_INTERFACE(QMacAccessibilityElement, NSObject -(void) invalidate;) QT_BEGIN_NAMESPACE bool QAccessibleCache
Definition
qaccessiblecache_mac.mm:8
qtbase
src
gui
accessible
qaccessiblecache_mac.mm
Generated on
for Qt by
1.18.0