ServiceManager QML Type

The ServiceManager is the central instance loading the backends and providing ServiceObjects. More...

Import Statement: import QtIvi 1.0
Instantiates: QIviServiceManager


Detailed Description

The ServiceManager singleton provides a model which can be used to list all available backends and their interfaces.

This can be useful when you want to query all available backends for a specific interface. E.g. showing a list of all available backends which implement the MediaPlayer interface. This could be used to provide the user the options, to select between multiple options. e.g. local playback, or playback using a bluetooth device.

The ServiceManager implements the QAbstractListModel interface and provides the following roles:

Role nameTypeDescription
namestringThe name of the backend e.g. MediaPlugin
serviceObjectServiceObjectThe actual QIviServiceObject, which can be used to connect a frontend API to this backend.

Note: When using this role in the data() function, the backend plugin will be loaded and instantiated.

interfaceslist<string>A list of interfaces implemented by the backend.

Note: Please see the C++ documentation for more information about what the QIviServiceManager is and how it works.

Method Documentation

list<ServiceObject> findServiceByInterface(interface, searchFlags)

Returns a list of backends implementing the specified interface.

The searchFlags argument can be used to control which type of backends are included in the search result:

IncludeProductionBackendsInclude production backends in the search result. See also ProductionBackend
IncludeSimulationBackendsInclude simulation backends in the search result. See also SimulationBackend
IncludeAllInclude production and simulation backends in the search result

bool hasInterface(interface)

Returns true if the specified interface has been registered.

© 2020 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.