diff options
Diffstat (limited to 'src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp')
-rw-r--r-- | src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp b/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp index 6b2f32f3..6213355e 100644 --- a/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp +++ b/src/imports/bluetooth/qdeclarativebluetoothdiscoverymodel.cpp @@ -165,14 +165,6 @@ QDeclarativeBluetoothDiscoveryModel::QDeclarativeBluetoothDiscoveryModel(QObject this, &QDeclarativeBluetoothDiscoveryModel::errorDiscovery); d->m_serviceAgent->setObjectName(QStringLiteral("ServiceDiscoveryAgent")); - - QHash<int, QByteArray> roleNames; - roleNames = QAbstractItemModel::roleNames(); - roleNames.insert(Name, "name"); - roleNames.insert(ServiceRole, "service"); - roleNames.insert(RemoteAddress, "remoteAddress"); - roleNames.insert(DeviceName, "deviceName"); - setRoleNames(roleNames); } QDeclarativeBluetoothDiscoveryModel::~QDeclarativeBluetoothDiscoveryModel() @@ -314,6 +306,14 @@ QVariant QDeclarativeBluetoothDiscoveryModel::data(const QModelIndex &index, int return QVariant(); } +QHash<int,QByteArray> QDeclarativeBluetoothDiscoveryModel::roleNames() const +{ + return {{Name, "name"}, + {ServiceRole, "service"}, + {RemoteAddress, "remoteAddress"}, + {DeviceName, "deviceName"}}; +} + /*! \qmlsignal BluetoothDiscoveryModel::serviceDiscovered(BluetoothService service) |