-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeviceinfo.h
38 lines (28 loc) · 866 Bytes
/
deviceinfo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright (C) 2013 BlackBerry Limited. All rights reserved.
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef DEVICEINFO_H
#define DEVICEINFO_H
#include <QBluetoothDeviceInfo>
#include <QList>
#include <QObject>
#include <QQmlEngine>
class DeviceInfo: public QObject
{
Q_OBJECT
Q_PROPERTY(QString deviceName READ getName NOTIFY deviceChanged)
Q_PROPERTY(QString deviceAddress READ getAddress NOTIFY deviceChanged)
QML_ANONYMOUS
public:
DeviceInfo() = default;
DeviceInfo(const QBluetoothDeviceInfo &d);
QString getAddress() const;
QString getName() const;
QBluetoothDeviceInfo getDevice();
void setDevice(const QBluetoothDeviceInfo &dev);
Q_SIGNALS:
void deviceChanged();
private:
QBluetoothDeviceInfo device;
};
#endif // DEVICEINFO_H