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
QtEmbeddedLoader.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.content.Context;
7import android.content.ContextWrapper;
8
9class QtEmbeddedLoader extends QtLoader {
10 private static final String TAG = "QtEmbeddedLoader";
11
12 private QtEmbeddedLoader(Context context) throws IllegalArgumentException {
13 super(new ContextWrapper(context));
14 // TODO Service context handling QTBUG-118874
15 int displayDensity = context.getResources().getDisplayMetrics().densityDpi;
16 setEnvironmentVariable("QT_ANDROID_THEME_DISPLAY_DPI", String.valueOf(displayDensity));
17 String stylePath = ExtractStyle.setup(context, "minimal", displayDensity);
18 setEnvironmentVariable("ANDROID_STYLE_PATH", stylePath);
19 setEnvironmentVariable("QT_ANDROID_NO_EXIT_CALL", String.valueOf(true));
20
21 extractContextMetaData(context);
22 }
23
24 static QtEmbeddedLoader getEmbeddedLoader(Context context) throws IllegalArgumentException {
25 if (m_instance == null)
26 m_instance = new QtEmbeddedLoader(context);
27 return (QtEmbeddedLoader) m_instance;
28 }
29}
QPainter Context
static const QString context()
Definition java.cpp:398