AbstractFeatureListModel QML Type

The QIfAbstractFeatureListModel is the base class for QtInterfaceFramework Features which should act as a model. More...

Import Statement: import QtInterfaceFramework
In C++: QIfAbstractFeatureListModel
Inherited By:

PagingModel

Properties

Methods

Detailed Description

This base class is necessary to avoid virtual inheritance from QAbstractListModel and QIfAbstractFeature.

This element is not directly accessible from QML. It provides the base QML properties for the feature, like autoDiscovery and isValid.

For more details on how a Feature works, see QIfAbstractFeature. For more information about models in QtInterfaceFramework, see Models.

See also AbstractFeature.

Property Documentation

asynchronousBackendLoading : bool [since 6.8]

This property holds whether backend loading is asynchronous.

By default, this property is false.

If set to true, the backend loading is asynchronous. This means that the feature will not wait for the backend to complete loading during auto discovery. Instead, the backend loads in the background and the feature will be updated once the backend is ready.

Note: This property defaults to true if the AbstractFeatureListModel is created within an asynchronous QQmlIncubator (e.g. Loader).

This property was introduced in Qt 6.8.


backendUpdatesEnabled : bool [since 6.8]

This property holds whether backend updates are enabled

By default, this property is true.

setBackendUpdatesEnabled() is normally used to disable updates for a short period of time, for instance to skip expensive updates while the application is currently not visible on the screen.

This is especially useful when backend upates are triggered over an IPC and received by multiple applications. By disabling updates, the application can avoid unnecessary updates.

A change to this property will cause the connectToServiceObject() and disconnectFromServiceObject() functions to be called, depending on the new value.

This property was introduced in Qt 6.8.


configurationId : string [since 6.5]

Holds the id to determine which configuration this feature belongs to.

Once the id has been set, it is possible to change certain values using the InterfaceFrameworkConfiguration API.

Note: Values set in the matching InterfaceFrameworkConfiguration can override the initial values set during the component creation.

This property was introduced in Qt 6.5.

See also InterfaceFrameworkConfiguration.


discoveryMode : enumeration

Holds the mode that is used for the autoDiscovery

Available values are:

ConstantDescription
NoAutoDiscoveryNo auto discovery is done and the ServiceObject needs to be set manually.
AutoDiscoveryTries to find a production backend with a matching interface and falls back to a simulation backend if not found.
LoadOnlyProductionBackendsOnly tries to load a production backend with a matching interface.
LoadOnlySimulationBackendsOnly tries to load a simulation backend with a matching interface.

If needed the auto discovery will be started once the Feature creation is completed.

Note: If you change this property after the Feature is instantiated you need to call startAutoDiscovery() to search for a new Service Object


discoveryResult : enumeration [read-only]

The result of the last autoDiscovery attempt

Available values are:

ConstantDescription
NoResultIndicates that no auto discovery was started because the feature already has a valid ServiceObject assigned or no result could be returned as the backend is loaded asynchronously.
ErrorWhileLoadingAn error has happened while searching for a backend with a matching interface.
ProductionBackendLoadedAs a result of the auto discovery a production backend was loaded.
SimulationBackendLoadedAs a result of the auto discovery a simulation backend was loaded.

error : string [read-only]

Last error message of the feature. Empty if no error.


isInitialized : bool [read-only]

Indicates whether the feature has been initialized with all the values from the backend.

The property is true once the backend sends the QIfFeatureInterface::initializationDone signal to indicate that all values have now been initialized with values from the backend.

See also isValid and QIfFeatureInterface::initializationDone.


isValid : bool [read-only]

Indicates whether the feature is ready for use.

The property is true if the feature is ready to be used, otherwise false. Not being ready usually indicates that no suitable service object could be found, or that automatic discovery has not been triggered.

The backend still might not have sent all properties yet and is not fully initialized. Use isInitialized instead to know when the feature holds all correct values.

See also QIfServiceObject, discoveryMode, and isInitialized.


preferredBackends : list<string> [since 6.5]

Holds a list of wildcards to load the preferred backend during auto discovery.

The auto discovery mechanism will automatically search for backends which provide a matching interface for this feature implementation. See startAutoDiscovery() for more information.

In case multiple backends implement the same interface, the list of wildcards can be used to determine the correct one to load.

The wildcards are applied in order to the found backends. If the wildcard matches some backends those backends will be loaded, otherwise the next wildcard is used.

For example: Given an AbstractFeature with two backends, backend_mqtt.so and backend_qtro.so, the property can be set to "*_mqtt*" to always select the backend_mqtt.so backend when available.

This property was introduced in Qt 6.5.


serviceObject : ServiceObject

Sets the service object for the feature.

As features only expose the front API facing the developer, a service object implementing the actual function is required. This is usually retrieved through the auto discovery mechanism.

The setter for this property returns false if the Service Object is already set to exactly this instance or the Service Object doesn't get accepted by the feature.

See also discoveryMode.


Method Documentation

enumeration startAutoDiscovery()

Performs an automatic discovery attempt.

See AbstractFeature::startAutoDiscovery() for more information


© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.