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
org.qtproject.qt.android.QtQuickViewContent Class Referenceabstract
Collaboration diagram for org.qtproject.qt.android.QtQuickViewContent:

Public Member Functions

abstract String getLibraryName ()
abstract String getModuleName ()
abstract String getFilePath ()
void setStatusChangeListener (QtQmlStatusChangeListener listener)
boolean disconnectSignalListener (int signalListenerId)
void invokeMethod (String name, Object[] params)
void invokeMethod (String name)

Protected Member Functions

QtQuickView getQuickView ()
boolean isViewAttached ()
void attachView (QtQuickView view)
void detachView ()
HashMap< String, Objectattributes ()
void setProperty (String propertyName, Object value)
int connectSignalListener (String signalName, Class<?>[] argTypes, Object listener)

Detailed Description

The QtQuickViewContent represents a QML component that can be loaded by a QtQuickView instance.

This abstract class should be extended to be used by a QtQuickView. It provides QtQuickView with essential information to load the QML component it represents. It also offers convenient methods for seamless interaction with the QtQuickView that loads it. @Since 6.8

Definition at line 20 of file QtQuickViewContent.java.

Member Function Documentation

◆ attachView()

void org.qtproject.qt.android.QtQuickViewContent.attachView ( QtQuickView view)
inlineprotected

Attaches this to a QtQuickView instance.

Definition at line 78 of file QtQuickViewContent.java.

References view.

◆ attributes()

HashMap< String, Object > org.qtproject.qt.android.QtQuickViewContent.attributes ( )
inlineprotected

Implement this to return more information about the QML Component. Default implementation returns an empty HashMap.

Definition at line 109 of file QtQuickViewContent.java.

◆ connectSignalListener()

int org.qtproject.qt.android.QtQuickViewContent.connectSignalListener ( String signalName,
Class<?>[] argTypes,
Object listener )
inlineprotected

Connects a SignalListener to a signal of the QML component if it has already been attached and loaded by a QtQuickView instance. Otherwise, the connection is executed once the component is attached to a view.

Parameters
signalNamethe name of the root object signal
argTypesthe Class types of the signal arguments
listeneran instance of the QtSignalListener interface
Returns
a connection ID between signal and listener or the existing connection ID if there is an existing connection between the same signal and listener. Return a negative value if the signal does not exist on the QML root object. Always returns true if the component is not yet attached to a QtQuickView instance.

Definition at line 195 of file QtQuickViewContent.java.

References Class, getQuickView(), isViewAttached(), signalName(), String, and view.

Here is the call graph for this function:

◆ detachView()

void org.qtproject.qt.android.QtQuickViewContent.detachView ( )
inlineprotected

Detaches this from the QtQuickView to which it has previously been attached. A call to this method will disconnect all signal listeners that have been connected before.

Definition at line 91 of file QtQuickViewContent.java.

References getQuickView(), org.qtproject.qt.android.QtQmlStatus.NULL, and view.

Here is the call graph for this function:

◆ disconnectSignalListener()

boolean org.qtproject.qt.android.QtQuickViewContent.disconnectSignalListener ( int signalListenerId)
inline

Disconnects a SignalListener with a given id obtained from QtQuickView#connectSignalListener(String, Class, QtSignalListener) or QtQuickView#connectSignalListener(String, Class[], Object) call, from listening to a signal.

Parameters
signalListenerIdthe connection id
Returns
Returns true if the connection id is valid and has been successfully removed, otherwise returns false.

Definition at line 218 of file QtQuickViewContent.java.

References getQuickView(), isViewAttached(), and view.

Here is the call graph for this function:

◆ getFilePath()

abstract String org.qtproject.qt.android.QtQuickViewContent.getFilePath ( )
abstract

Implement this to return the qrc (Qt Resource) path of this QML component.

References String.

◆ getLibraryName()

abstract String org.qtproject.qt.android.QtQuickViewContent.getLibraryName ( )
abstract

Implement this to return the library name that this component belongs to.

References String.

◆ getModuleName()

abstract String org.qtproject.qt.android.QtQuickViewContent.getModuleName ( )
abstract

Implement this to return the module name that this component belongs to.

References String.

◆ getQuickView()

QtQuickView org.qtproject.qt.android.QtQuickViewContent.getQuickView ( )
inlineprotected

Gets the QtQuickView instance that has loaded this component.

Returns
Returns an instance of QtQuickView or null if this component is not loaded by any QtQuickView.

Definition at line 61 of file QtQuickViewContent.java.

Referenced by connectSignalListener(), detachView(), disconnectSignalListener(), invokeMethod(), invokeMethod(), isViewAttached(), setProperty(), and setStatusChangeListener().

Here is the caller graph for this function:

◆ invokeMethod() [1/2]

void org.qtproject.qt.android.QtQuickViewContent.invokeMethod ( String name)
inline

Invokes a QML method of the root object.

Parameters
namename of the method
See also
QtQuickViewContent.invokeMethod(String, Object[])

Definition at line 272 of file QtQuickViewContent.java.

References getQuickView(), Log, String, and view.

Here is the call graph for this function:

◆ invokeMethod() [2/2]

void org.qtproject.qt.android.QtQuickViewContent.invokeMethod ( String name,
Object[] params )
inline

Invokes a QML method of the root object.

Supported parameter 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 types: int, double, real, bool, and string, respectively.

Parameters
namename of the method
paramsarray of parameters that are passed to the method
See also
QML int
QML double
QML real
QML bool
QML string

Definition at line 253 of file QtQuickViewContent.java.

References getQuickView(), Log, String, and view.

Here is the call graph for this function:

◆ isViewAttached()

boolean org.qtproject.qt.android.QtQuickViewContent.isViewAttached ( )
inlineprotected

Checks if this is currently attached to a QtQuickView instance

Returns
Returns true if this is attached to a QtQuickView instance, otherwise, returns false.

Definition at line 73 of file QtQuickViewContent.java.

References getQuickView().

Referenced by connectSignalListener(), and disconnectSignalListener().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setProperty()

void org.qtproject.qt.android.QtQuickViewContent.setProperty ( String propertyName,
Object value )
inlineprotected

Sets the value of an existing property on the QML component if it has already been attached and loaded by a QtQuickView instance. 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.

Parameters
propertyNamethe name of the existing QML property to set the value of
valuethe value to set the property to QML's int, double/float, bool or string
See also
QML int
QML double/float
QML bool
QML string

Definition at line 127 of file QtQuickViewContent.java.

References getQuickView(), Log, String, and view.

Here is the call graph for this function:

◆ setStatusChangeListener()

void org.qtproject.qt.android.QtQuickViewContent.setStatusChangeListener ( QtQmlStatusChangeListener listener)
inline

Sets a StatusChangeListener to listen to status changes.

Parameters
listeneran instance of a StatusChangeListener interface

Definition at line 47 of file QtQuickViewContent.java.

References getQuickView(), and view.

Here is the call graph for this function:

The documentation for this class was generated from the following file: