ServiceFilter QML Type
The ServiceFilter element holds a list of ServiceDescriptor objects. More...
Import Statement: | import |
Properties
- interfaceName : QString
- majorVersion : int
- minorVersion : int
- monitorServiceRegistrations : int
- serviceDescriptions : QQmlListProperty
- serviceName : QString
- versionMatch : bool
Detailed Description
The ServiceFilter element is part of the Qt ServiceFramework API and provides a list of QServiceDesciptor objects at the interface ServiceFilter::interfaceName with minimum version match ServiceFilter::minVersion properties. This list can be used to select the desired service and instantiate a service object for access via the QMetaObject.
This element is a simplified reflection of the QServiceFilter class that provides a list of ServiceDescriptors. Similarly, if the ServiceFilter::serviceName and ServiceFilter::versionMatch are not provided they will respectively default to an empty string with a minimum verison match.
Example:
Item { ServiceFilter { id: serviceFilter interfaceName: "com.qt.nokia.example.interface" } ServiceLoader { serviceDescriptor: serviceFilter.serviceDescriptions[0] //To get the first matching service } Repeater{ //To instantiate an object for all matching services. model: serviceFilter.serviceDescriptions Item { ServiceLoader { serviceDescriptor: modelData } } } }
See also ServiceLoader and ServiceDescriptor.
Property Documentation
This property holds the interface name of the services that corresponds to setting QServiceFilter::setInterface().
This property holds the major version number of the service filter that corresponds to QServiceFilter::majorVersion().
This property holds the minor version number of the service filter that corresponds to QServiceFilter::minorVersion().
This property controls the behaviour of the list when new services are registered or deregistered. Setting this property to true means the list will be automatically updated when a service is added or removed.
Continuing to monitor the services can be expensive, so it is recommended that you only enable this feature if you need it.
Caution, your service descriptor object will be deleted if the service is unregistered, even if the service is still running. This is primarily of note if you are using the serviceDescriptions list as a model with Service element delegates.
This property holds the list of ServiceDescriptor objects that match the ServiceFilter::interfaceName and minimum ServiceFilter::versionNumber properties.
This property holds the interface name of the services that corresponds to setting QServiceFilter::setService().
This property holds the version match rule of the service filter that corresponds to QServiceFilter::versionMatchRule(). Within QML the values ServiceFilter.Exact and ServiceFilter.Minimum correspond to QServiceFilter::ExactVersionMatch and QServiceFilter::MinimumVersionMatch respectively.