- Major styling improvements

- Some renaming
This commit is contained in:
Dorian Zedler 2020-10-17 21:51:33 +02:00
parent 1ec609e7c2
commit 534277a198
Signed by: dorian
GPG Key ID: D3B255CB8BC7CD37
4 changed files with 10 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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