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
QtEmbeddedDelegateFactory.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
4package org.qtproject.qt.android;
5
6import android.app.Activity;
7import android.app.Application;
8import android.os.Bundle;
9
10import java.util.HashMap;
11
12class QtEmbeddedDelegateFactory {
13 private static final HashMap<Activity, QtEmbeddedDelegate> m_delegates = new HashMap<>();
14 private static final Object m_delegateLock = new Object();
15
16 @UsedFromNativeCode
17 public static QtActivityDelegateBase getActivityDelegate(Activity activity) {
18 synchronized (m_delegateLock) {
19 return m_delegates.get(activity);
20 }
21 }
22
23 public static QtEmbeddedDelegate create(Activity activity) {
24 synchronized (m_delegateLock) {
25 if (!m_delegates.containsKey(activity))
26 m_delegates.put(activity, new QtEmbeddedDelegate(activity));
27
28 return m_delegates.get(activity);
29 }
30 }
31
32 public static void remove(Activity activity) {
33 synchronized (m_delegateLock) {
34 m_delegates.remove(activity);
35 }
36 }
37}
Definition main.cpp:8
Q_CORE_EXPORT QtJniTypes::Activity activity()
view create()