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
qandroidquickviewembedding_p.h
Go to the documentation of this file.
1// Copyright (C) 2023 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#ifndef QANDROIDQUICKVIEWEMBEDDING_P_H
5#define QANDROIDQUICKVIEWEMBEDDING_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/qjnienvironment.h>
19#include <QtCore/qjnitypes.h>
20#include <QtQuick/qquickview.h>
21
23
24Q_DECLARE_JNI_TYPE(StringArray, "[Ljava/lang/String;")
25
27{
29 void createQuickView(JNIEnv *env, jobject nativeWindow, jstring qmlUri, jint width, jint height,
30 jlong parentWindowReference, QtJniTypes::StringArray qmlImportPaths);
31 Q_DECLARE_JNI_NATIVE_METHOD_IN_CURRENT_SCOPE(createQuickView)
32 void setRootObjectProperty(JNIEnv *env, jobject, jlong parentWindowReference,
33 jstring propertyName, jobject value);
34 Q_DECLARE_JNI_NATIVE_METHOD_IN_CURRENT_SCOPE(setRootObjectProperty)
35 jobject getRootObjectProperty(JNIEnv *env, jobject, jlong parentWindowReference,
36 jstring propertyName);
37 Q_DECLARE_JNI_NATIVE_METHOD_IN_CURRENT_SCOPE(getRootObjectProperty)
38 int addRootObjectSignalListener(JNIEnv *env, jobject, jlong parentWindowReference,
39 jstring signalName, jclass argType, jobject listener);
40 Q_DECLARE_JNI_NATIVE_METHOD_IN_CURRENT_SCOPE(addRootObjectSignalListener)
41 bool removeRootObjectSignalListener(JNIEnv *env, jobject, jlong parentWindowReference,
42 jint signalListenerId);
43 Q_DECLARE_JNI_NATIVE_METHOD_IN_CURRENT_SCOPE(removeRootObjectSignalListener)
44
45 class SignalHelper : public QObject
46 {
48 public:
58
60 explicit SignalHelper(QQuickView *parent) : QObject(parent), connectionHandleCounter(0) { }
61 QMultiMap<QByteArray, ListenerInfo> listenersMap;
62 QHash<int, QMetaObject::Connection> connections;
63 void invokeListener(QObject *sender, int senderSignalIndex, QVariant signalValue);
64
65 template<typename JT, typename T>
67 return QJniObject(QtJniTypes::Traits<JT>::className(), get<T>(std::move(v)));
68 };
69
70 public slots:
71 void forwardSignal();
72 void forwardSignal(int);
73 void forwardSignal(double);
74 void forwardSignal(float);
75 void forwardSignal(bool);
76 void forwardSignal(QString);
77 };
78};
79
81
82#endif // QANDROIDQUICKVIEWEMBEDDING_P_H
Q_DECLARE_JNI_TYPE(StringArray, "[Ljava/lang/String;")
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore
\inmodule QtCore
\inmodule QtCore
Definition qobject.h:103
The QQuickView class provides a window for displaying a Qt Quick user interface.
Definition qquickview.h:20
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qvariant.h:65
QHash< int, QMetaObject::Connection > connections
QMultiMap< QByteArray, ListenerInfo > listenersMap
static bool registerNatives()
Combined button and popup list for selecting options.
void setRootObjectProperty(JNIEnv *env, jobject object, jlong windowReference, jstring propertyName, jobject value)
void createQuickView(JNIEnv *, jobject nativeWindow, jstring qmlUri, jint width, jint height, jlong parentWindowReference, QtJniTypes::StringArray qmlImportPaths)
bool removeRootObjectSignalListener(JNIEnv *, jobject, jlong windowReference, jint signalListenerId)
jobject getRootObjectProperty(JNIEnv *env, jobject object, jlong windowReference, jstring propertyName)
int addRootObjectSignalListener(JNIEnv *env, jobject, jlong windowReference, jstring signalName, jclass argType, jobject listener)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLsizei const GLfloat * v
[13]
GLint GLsizei GLsizei height
GLint GLsizei width
#define Q_OBJECT
#define slots
static QWindowsDirect2DWindow * nativeWindow(QWindow *window)