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
QtEmbeddedViewInterfaceFactory.java
Go to the documentation of this file.
1
// Copyright (C) 2024 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
package
org.qtproject.qt.android;
5
6
import
android.content.Context;
7
import
android.app.Activity;
8
import
android.app.Service;
9
10
import
java.util.HashMap;
11
12
class
QtEmbeddedViewInterfaceFactory {
13
private
static
final
HashMap<Context, QtEmbeddedViewInterface> m_interfaces =
new
HashMap<>();
14
private
static
final
Object
m_interfaceLock =
new
Object
();
15
16
static
QtEmbeddedViewInterface create(
Context
context) {
17
synchronized
(m_interfaceLock) {
18
if
(!m_interfaces.containsKey(context)) {
19
if
(context instanceof Activity)
20
m_interfaces.put(context,
new
QtEmbeddedDelegate((Activity)context));
21
else
if
(context instanceof Service)
22
m_interfaces.put(context,
new
QtServiceEmbeddedDelegate((Service)context));
23
}
24
25
return
m_interfaces.get(context);
26
}
27
}
28
29
static
void
remove
(
Context
context
) {
30
synchronized
(m_interfaceLock) {
31
m_interfaces.remove(context);
32
}
33
}
34
}
Context
QPainter Context
Definition
container_qpainter.cpp:30
QQmlPrivate::ObjectLookupResult::Object
@ Object
Definition
qqml.cpp:1714
src_gui_qopenglshaderprogram::context
QObject * context
Definition
src_gui_qopenglshaderprogram.cpp:9
qtbase
src
android
jar
src
org
qtproject
qt
android
QtEmbeddedViewInterfaceFactory.java
Generated on
for Qt by
1.18.0