diff options
author | Fabian Bumberger <fbumberger@rim.com> | 2013-09-18 16:16:12 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-18 17:24:43 +0200 |
commit | e071e7157797caf99a8cac990fc4066fcb6589ca (patch) | |
tree | 0e6e16ec650e607c7f8d5944c43a0dd922e58a47 /src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp | |
parent | 9fa7195f0f2b8e7148215df564240dbfdad34935 (diff) |
Add remote address property to QBluetoothDiscoveryModel
Change-Id: I979eaa15d62606206c4c175dcdcaf9d1691f4117
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp')
-rw-r--r-- | src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp b/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp index b3077073..47ea4b6d 100644 --- a/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp +++ b/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp @@ -105,6 +105,7 @@ public: bool m_running; bool m_runningRequested; bool m_componentCompleted; + QString m_remoteAddress; }; QDeclarativeBluetoothDiscoveryModel::QDeclarativeBluetoothDiscoveryModel(QObject *parent) : @@ -397,6 +398,8 @@ void QDeclarativeBluetoothDiscoveryModel::setRunning(bool running) connect(d->m_serviceAgent, SIGNAL(error(QBluetoothServiceDiscoveryAgent::Error)), this, SLOT(errorDiscovery(QBluetoothServiceDiscoveryAgent::Error))); } + d->m_serviceAgent->setRemoteAddress(QBluetoothAddress(d->m_remoteAddress)); + if (!d->m_uuid.isEmpty()) d->m_serviceAgent->setUuidFilter(QBluetoothUuid(d->m_uuid)); @@ -443,3 +446,26 @@ void QDeclarativeBluetoothDiscoveryModel::setUuidFilter(QString uuid) d->m_uuid = uuid; emit uuidFilterChanged(); } + +/*! + \qmlproperty string BluetoothDiscoveryModel::remoteAddress + + This property holds an optional bluetooth address for a remote bluetooth device. + Only services on this remote device will be discovered. It has no effect if + an invalid bluetooth address was set or if the property was set after the discovery + was started. + + The property is ignored if device discovery is selected. + +*/ + +QString QDeclarativeBluetoothDiscoveryModel::remoteAddress() +{ + return d->m_remoteAddress; +} + +void QDeclarativeBluetoothDiscoveryModel::setRemoteAddress(QString address) +{ + d->m_remoteAddress = address; + Q_EMIT remoteAddressChanged(); +} |