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>.
|
Classes | |
interface | SignalListener |
interface | StatusChangeListener |
Public Member Functions | |
QtQuickView (Context context, String qmlUri, String appName) throws InvalidParameterException | |
QtQuickView (Context context, String qmlUri, String appName, String[] qmlImportPaths) throws InvalidParameterException | |
void | setProperty (String propertyName, Object value) |
boolean | disconnectSignalListener (int signalListenerId) |
int | getStatus () |
void | setStatusChangeListener (StatusChangeListener listener) |
Static Public Attributes | |
static final int | STATUS_NULL = 0 |
static final int | STATUS_READY = 1 |
static final int | STATUS_LOADING = 2 |
static final int | STATUS_ERROR = 3 |
Protected Member Functions | |
void | createWindow (long parentWindowReference) |
The QtQuickView class lets you easily add QML content to your Android app as a View
. QtQuickView instantiates a QQuickView with a given QML component source URI path and embeds it inside itself. You can add it in your Android app's layout as with any other View. QtQuickView is a good choice when you want to extend your non-Qt Android app with QML content but do not want to make the entire app using the Qt framework. It brings the power of Qt Quick into your Android app, making it possible to use various Qt Quick APIs, in Android Java or Kotlin apps.
Note: This class is a technical preview. It is subject to change, and no source nor binary compatibility guarantees exist.
Known limitations:
Definition at line 32 of file QtQuickView.java.
|
inline |
Creates a QtQuickView to load and view a QML component. Instantiating a QtQuickView will load the Qt libraries, including the app library specified by appName
. Then it creates a QQuickView that loads the QML source specified by qmlUri
.
context | the parent Context |
qmlUri | the URI of the main QML file |
appName | the name of the Qt app library to load and start. This corresponds to the target name set in Qt app's CMakeLists.txt |
InvalidParameterException | if either qmlUri or appName is empty or null |
Definition at line 109 of file QtQuickView.java.
References context.
|
inline |
Creates a QtQuickView to load and view a QML component. Instantiating a QtQuickView will load the Qt libraries, including the app library specified by appName. Then it creates a QQuickView that loads the QML source specified by qmlUri. This overload accepts an array of strings in the case where the QML application should load QML modules from custom paths.
context | the parent Context |
qmlUri | the URI of the main QML file |
appName | the name of the Qt app library to load and start. This corresponds to the target name set in the Qt app's CMakeLists.txt |
qmlImportPaths | an array of strings for additional import paths to be passed to QQmlEngine, or null if additional import paths are not required |
InvalidParameterException | if either qmlUri or appName is empty or null |
Definition at line 129 of file QtQuickView.java.
References context.
|
inlineprotected |
Definition at line 142 of file QtQuickView.java.
|
inline |
Disconnects a SignalListener with a given id obtained from connectSignalListener
call, from listening to a signal.
signalListenerId | the connection id |
Definition at line 219 of file QtQuickView.java.
|
inline |
Gets the status of the QML component.
setProperty
, getProperty
, and addSignalListener
) would succeed only if the current STATUS_READY. It can also return STATUS_NULL, STATUS_LOADING, or STATUS_ERROR based on the status of see underlaying Definition at line 235 of file QtQuickView.java.
Sets the value of an existing property on the QML root object. The supported types are java.lang.Integer
, java.lang.Double
, java.lang.Float
, java.lang.Boolean
and java.lang.String
. These types get converted to their corresponding QML types int, double/float, bool and string. This function does not add properties to the QML root object if they do not exist, but prints a warning.
propertyName | the name of the existing root object property to set the value of |
value | the value to set the property to |
Definition at line 160 of file QtQuickView.java.
|
inline |
Sets a StatusChangeListener to listen to status changes.
listener | an instance of a StatusChangeListener interface |
Definition at line 245 of file QtQuickView.java.
References org.qtproject.qt.android.QtQuickView.StatusChangeListener.onStatusChanged().
|
static |
QML loading status: One or more errors has occurred.
Definition at line 81 of file QtQuickView.java.
|
static |
QML loading status: The QML view is loading the root object from network.
Definition at line 77 of file QtQuickView.java.
|
static |
QML loading status: No source is set or the root object has not been created yet.
Definition at line 65 of file QtQuickView.java.
|
static |
QML loading status: The QML view is loaded and the root object is available. Invoking methods that operate on the QML root object, i.e. setProperty
, getProperty
, and addSignalListener
would succeed only if the current status is ready.
Definition at line 73 of file QtQuickView.java.