- Major styling improvements
- Some renaming
This commit is contained in:
parent
1ec609e7c2
commit
534277a198
4 changed files with 10 additions and 4 deletions
|
@ -19,11 +19,11 @@ CONFIG += c++11
|
|||
INCLUDEPATH += $$PWD/
|
||||
|
||||
SOURCES += \
|
||||
$$PWD/qbluetoothleuart.cpp \
|
||||
$$PWD/qbluetoothleuartclient.cpp \
|
||||
$$PWD/qbluetoothleuartdevice.cpp \
|
||||
$$PWD/qbluetoothleuartdevicemodel.cpp
|
||||
|
||||
HEADERS += \
|
||||
$$PWD/qbluetoothleuart.h \
|
||||
$$PWD/qbluetoothleuartclient.h \
|
||||
$$PWD/qbluetoothleuartdevice.h \
|
||||
$$PWD/qbluetoothleuartdevicemodel.h
|
||||
|
|
|
@ -20,7 +20,7 @@ class QBluetoothLeUartDevice: public QObject
|
|||
public:
|
||||
QBluetoothLeUartDevice(QBluetoothDeviceInfo device, QObject *parent = nullptr);
|
||||
|
||||
friend class QBluetoothLeUart;
|
||||
friend class QBluetoothLeUartClient;
|
||||
|
||||
/*!
|
||||
* \brief Function to get the name of the device
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
QBluetoothLeUartDeviceModel::QBluetoothLeUartDeviceModel(QList<QBluetoothLeUartDevice*> availableDevices, QObject* parent) : QAbstractListModel(parent)
|
||||
{
|
||||
this->availableDevices = availableDevices;
|
||||
connect(this, &QBluetoothLeUartDeviceModel::rowsInserted, this, &QBluetoothLeUartDeviceModel::rowCountChanged);
|
||||
connect(this, &QBluetoothLeUartDeviceModel::rowsRemoved, this, &QBluetoothLeUartDeviceModel::rowCountChanged);
|
||||
}
|
||||
|
||||
int QBluetoothLeUartDeviceModel::rowCount(const QModelIndex &) const
|
||||
|
|
|
@ -35,8 +35,9 @@
|
|||
class QBluetoothLeUartDeviceModel : public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int rowCount READ rowCount NOTIFY rowCountChanged)
|
||||
public:
|
||||
friend class QBluetoothLeUart;
|
||||
friend class QBluetoothLeUartClient;
|
||||
|
||||
enum QBluetoothLeUartDeviceModelRole {
|
||||
NameRole = Qt::DisplayRole,
|
||||
|
@ -60,6 +61,9 @@ protected:
|
|||
private:
|
||||
QList<QBluetoothLeUartDevice*> availableDevices;
|
||||
|
||||
signals:
|
||||
void rowCountChanged();
|
||||
|
||||
};
|
||||
|
||||
#endif // QBLUETOOTHLEUARTDEVICEMODEL_H
|
||||
|
|
Loading…
Reference in a new issue