QIviMediaDeviceDiscoveryModel Class
Provides a model for discovering media devices. More...
Header: | #include <QIviMediaDeviceDiscoveryModel> |
qmake: | QT += ivimedia |
Instantiated By: | MediaDeviceDiscoveryModel |
Inherits: | QIviAbstractFeatureListModel |
Public Types
enum | Roles { NameRole, TypeRole, ServiceObjectRole } |
Properties
- count : const int
- 6 properties inherited from QIviAbstractFeatureListModel
- 1 property inherited from QObject
Public Functions
QIviMediaDeviceDiscoveryModel(QObject *parent = nullptr) | |
QIviMediaDevice * | at(int i) const |
QIviMediaDevice * | get(int i) const |
Reimplemented Public Functions
virtual QVariant | data(const QModelIndex &index, int role) const override |
virtual QHash<int, QByteArray> | roleNames() const override |
virtual int | rowCount(const QModelIndex &parent = QModelIndex()) const override |
- 7 public functions inherited from QIviAbstractFeatureListModel
- 4 public functions inherited from QAbstractListModel
- 2 public functions inherited from QQmlParserStatus
- 39 public functions inherited from QAbstractItemModel
- 32 public functions inherited from QObject
Signals
void | countChanged() |
void | deviceAdded(QIviMediaDevice *device) |
void | deviceRemoved(QIviMediaDevice *device) |
- 6 signals inherited from QIviAbstractFeatureListModel
- 18 signals inherited from QAbstractItemModel
- 2 signals inherited from QObject
Reimplemented Protected Functions
virtual void | clearServiceObject() override |
virtual void | connectToServiceObject(QIviServiceObject *serviceObject) override |
- 7 protected functions inherited from QIviAbstractFeatureListModel
- 19 protected functions inherited from QAbstractItemModel
- 9 protected functions inherited from QObject
Additional Inherited Members
- 3 public slots inherited from QIviAbstractFeatureListModel
- 2 public slots inherited from QAbstractItemModel
- 1 public slot inherited from QObject
- 1 public variable inherited from QObject
- 10 static public members inherited from QObject
- 7 protected functions inherited from QIviAbstractFeatureListModel
- 19 protected functions inherited from QAbstractItemModel
- 9 protected functions inherited from QObject
- 1 protected slot inherited from QIviAbstractFeatureListModel
- 1 protected slot inherited from QAbstractItemModel
- 2 protected variables inherited from QObject
Detailed Description
Provides a model for discovering media devices.
The QIviMediaDeviceDiscoveryModel provides a way to query for available media devices and to get notified when new media devices get added or are removed.
All devices listed here need to be a subclass of QIviMediaDevice.
The QIviMediaDeviceDiscoveryModel expects a single backend to be available. It is recommended to use it with discoveryMode set to QIviAbstractFeature::AutoDiscovery.
Member Type Documentation
enum QIviMediaDeviceDiscoveryModel::Roles
Constant | Value | Description |
---|---|---|
QIviMediaDeviceDiscoveryModel::NameRole | Qt::DisplayRole | The name of the media device. E.g. The name of the connected USB-Thumbdrive/SDCard or a connected Ipod. |
QIviMediaDeviceDiscoveryModel::TypeRole | Qt::UserRole | The type of the media device. See SupportedMediaDevices for a detailed listing. |
QIviMediaDeviceDiscoveryModel::ServiceObjectRole | Qt::UserRole + 1 | A pointer to the media device itself. This pointer can be used as the ServiceObject for other Features. E.g. The QIviSearchAndBrowseModel. |
Property Documentation
count : const int
Holds the current number of rows in this model.
Access functions:
virtual int | rowCount(const QModelIndex &parent = QModelIndex()) const override |
Notifier signal:
void | countChanged() |
Member Function Documentation
QIviMediaDeviceDiscoveryModel::QIviMediaDeviceDiscoveryModel(QObject *parent = nullptr)
Constructs a QIviMediaDeviceDiscoveryModel.
The parent argument is passed on to the QIviAbstractFeatureListModel base class.
QIviMediaDevice *QIviMediaDeviceDiscoveryModel::at(int i) const
Returns the media device at index i.
Note: The returned device is owned by the model and can be deleted at any time.
[override virtual protected]
void QIviMediaDeviceDiscoveryModel::clearServiceObject()
Reimplemented from QIviAbstractFeatureListModel::clearServiceObject().
[override virtual protected]
void QIviMediaDeviceDiscoveryModel::connectToServiceObject(QIviServiceObject *serviceObject)
Reimplemented from QIviAbstractFeatureListModel::connectToServiceObject().
[override virtual]
QVariant QIviMediaDeviceDiscoveryModel::data(const QModelIndex &index, int role) const
Reimplemented from QAbstractItemModel::data().
[signal]
void QIviMediaDeviceDiscoveryModel::deviceAdded(QIviMediaDevice *device)
This signal is emitted whenever a new media device got added. The new media device is passed as device.
[signal]
void QIviMediaDeviceDiscoveryModel::deviceRemoved(QIviMediaDevice *device)
This signal is emitted whenever a media device got removed. The device which got removed is passed as device. Afterwards the device will be deleted.
QIviMediaDevice *QIviMediaDeviceDiscoveryModel::get(int i) const
Returns the media device at index i.
Note: The returned device is owned by the model and can be deleted at any time.
[override virtual]
QHash<int, QByteArray> QIviMediaDeviceDiscoveryModel::roleNames() const
Reimplemented from QAbstractItemModel::roleNames().
© 2018 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.