diff --git a/qbluetoothleuart.h b/qbluetoothleuart.h index 09a6784..82ccfb0 100644 --- a/qbluetoothleuart.h +++ b/qbluetoothleuart.h @@ -19,7 +19,7 @@ * \section intro_sec Introduction * * This library can be used to talk to BLE devices via UART in Qt. - * It was designed to make taklking to device like the ESP32 from Qt easier. + * It was designed to make talking to devices like the ESP32 from Qt easier. * * \section section Installation * \code{.sh} @@ -35,6 +35,12 @@ * # Include library * include($$PWD/QBluetoothLeUart/QBluetoothLeUart.pri) * \endcode + * + * To enable the QML module you need to call + * \code{.cpp} + * QBluetoothLeUart::init(); + * \endcode + * somewhere before app.exec(); in your main.cpp. */ /*! diff --git a/qbluetoothleuartdevicemodel.cpp b/qbluetoothleuartdevicemodel.cpp index e851178..f351143 100644 --- a/qbluetoothleuartdevicemodel.cpp +++ b/qbluetoothleuartdevicemodel.cpp @@ -59,6 +59,11 @@ void QBluetoothLeUartDeviceModel::remove(int row) } void QBluetoothLeUartDeviceModel::clear() { - for(int i = 0; i < this->availableDevices.length(); i++) - this->remove(i); + + this->beginResetModel(); + this->resetInternalData(); + + this->availableDevices.clear(); + + this->endResetModel(); }