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
QtRootLayout.java
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// Copyright (C) 2012 BogDan Vatra <bogdan@kde.org>
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5package org.qtproject.qt.android;
6
7import android.app.Activity;
8import android.content.Context;
9import android.content.res.Configuration;
10
15class QtRootLayout extends QtLayout
16{
17 QtRootLayout(Context context)
18 {
19 super(context);
20 }
21
22 @Override
23 protected void onSizeChanged(int w, int h, int oldw, int oldh)
24 {
25 Activity activity = (Activity) getContext();
26 if (activity == null || (w == oldw && h == oldh))
27 return;
28
29 QtDisplayManager.handleLayoutSizeChanged(w, h);
30 }
31
32 @Override
33 public void onConfigurationChanged(Configuration configuration)
34 {
35 Activity activity = (Activity) getContext();
36 if (activity == null)
37 return;
38
39 // Post the orientation handling just in case the onSizeChanged() is
40 // called a bit late (QTBUG-94459).
41 QtNative.runAction(() -> {
42 QtDisplayManager.handleOrientationChange(activity);
43 });
44 }
45}
QPainter Context
static const QString context()
Definition java.cpp:398
Q_CORE_EXPORT QtJniTypes::Activity activity()
GLfloat GLfloat GLfloat w
[0]
GLfloat GLfloat GLfloat GLfloat h