- 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/
|
INCLUDEPATH += $$PWD/
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
$$PWD/qbluetoothleuart.cpp \
|
$$PWD/qbluetoothleuartclient.cpp \
|
||||||
$$PWD/qbluetoothleuartdevice.cpp \
|
$$PWD/qbluetoothleuartdevice.cpp \
|
||||||
$$PWD/qbluetoothleuartdevicemodel.cpp
|
$$PWD/qbluetoothleuartdevicemodel.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
$$PWD/qbluetoothleuart.h \
|
$$PWD/qbluetoothleuartclient.h \
|
||||||
$$PWD/qbluetoothleuartdevice.h \
|
$$PWD/qbluetoothleuartdevice.h \
|
||||||
$$PWD/qbluetoothleuartdevicemodel.h
|
$$PWD/qbluetoothleuartdevicemodel.h
|
||||||
|
|
|
@ -20,7 +20,7 @@ class QBluetoothLeUartDevice: public QObject
|
||||||
public:
|
public:
|
||||||
QBluetoothLeUartDevice(QBluetoothDeviceInfo device, QObject *parent = nullptr);
|
QBluetoothLeUartDevice(QBluetoothDeviceInfo device, QObject *parent = nullptr);
|
||||||
|
|
||||||
friend class QBluetoothLeUart;
|
friend class QBluetoothLeUartClient;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Function to get the name of the device
|
* \brief Function to get the name of the device
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
QBluetoothLeUartDeviceModel::QBluetoothLeUartDeviceModel(QList<QBluetoothLeUartDevice*> availableDevices, QObject* parent) : QAbstractListModel(parent)
|
QBluetoothLeUartDeviceModel::QBluetoothLeUartDeviceModel(QList<QBluetoothLeUartDevice*> availableDevices, QObject* parent) : QAbstractListModel(parent)
|
||||||
{
|
{
|
||||||
this->availableDevices = availableDevices;
|
this->availableDevices = availableDevices;
|
||||||
|
connect(this, &QBluetoothLeUartDeviceModel::rowsInserted, this, &QBluetoothLeUartDeviceModel::rowCountChanged);
|
||||||
|
connect(this, &QBluetoothLeUartDeviceModel::rowsRemoved, this, &QBluetoothLeUartDeviceModel::rowCountChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
int QBluetoothLeUartDeviceModel::rowCount(const QModelIndex &) const
|
int QBluetoothLeUartDeviceModel::rowCount(const QModelIndex &) const
|
||||||
|
|
|
@ -35,8 +35,9 @@
|
||||||
class QBluetoothLeUartDeviceModel : public QAbstractListModel
|
class QBluetoothLeUartDeviceModel : public QAbstractListModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
Q_PROPERTY(int rowCount READ rowCount NOTIFY rowCountChanged)
|
||||||
public:
|
public:
|
||||||
friend class QBluetoothLeUart;
|
friend class QBluetoothLeUartClient;
|
||||||
|
|
||||||
enum QBluetoothLeUartDeviceModelRole {
|
enum QBluetoothLeUartDeviceModelRole {
|
||||||
NameRole = Qt::DisplayRole,
|
NameRole = Qt::DisplayRole,
|
||||||
|
@ -60,6 +61,9 @@ protected:
|
||||||
private:
|
private:
|
||||||
QList<QBluetoothLeUartDevice*> availableDevices;
|
QList<QBluetoothLeUartDevice*> availableDevices;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void rowCountChanged();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QBLUETOOTHLEUARTDEVICEMODEL_H
|
#endif // QBLUETOOTHLEUARTDEVICEMODEL_H
|
||||||
|
|
Loading…
Reference in a new issue