chore: update files of project

This commit is contained in:
x-tools-author 2024-03-21 09:25:20 +08:00
parent 114a1e67a3
commit 4e334f5eb6
3 changed files with 16 additions and 16 deletions

View File

@ -11,7 +11,7 @@
#include <QBluetoothDeviceInfo>
#include <QMessageBox>
xToolsBluetoothDeviceInfoComboBox::xToolsBluetoothDeviceInfoComboBox(QWidget* parent)
xToolsBleDeviceInfoComboBox::xToolsBleDeviceInfoComboBox(QWidget* parent)
: xToolsComboBox(parent)
, mScanner(Q_NULLPTR)
{
@ -28,14 +28,14 @@ xToolsBluetoothDeviceInfoComboBox::xToolsBluetoothDeviceInfoComboBox(QWidget* pa
#endif
}
xToolsBluetoothDeviceInfoComboBox::~xToolsBluetoothDeviceInfoComboBox()
xToolsBleDeviceInfoComboBox::~xToolsBleDeviceInfoComboBox()
{
#if 0
mScanner->stopDiscover();
#endif
}
void xToolsBluetoothDeviceInfoComboBox::startDiscover()
void xToolsBleDeviceInfoComboBox::startDiscover()
{
#if 0
clear();
@ -43,14 +43,14 @@ void xToolsBluetoothDeviceInfoComboBox::startDiscover()
#endif
}
void xToolsBluetoothDeviceInfoComboBox::stopDiscover()
void xToolsBleDeviceInfoComboBox::stopDiscover()
{
#if 0
mScanner->stopDiscover();
#endif
}
bool xToolsBluetoothDeviceInfoComboBox::isActive()
bool xToolsBleDeviceInfoComboBox::isActive()
{
#if 0
return mScanner->isActive();
@ -58,19 +58,19 @@ bool xToolsBluetoothDeviceInfoComboBox::isActive()
return false;
}
void xToolsBluetoothDeviceInfoComboBox::setTimeoutInterval(int interval)
void xToolsBleDeviceInfoComboBox::setTimeoutInterval(int interval)
{
#if 0
mScanner->setTimeoutInterval(interval);
#endif
}
void xToolsBluetoothDeviceInfoComboBox::setNameFiltter(const QString& filtter)
void xToolsBleDeviceInfoComboBox::setNameFiltter(const QString& filtter)
{
// mScanner->setNameFiltter(filtter);
}
void xToolsBluetoothDeviceInfoComboBox::changeEvent(QEvent* event)
void xToolsBleDeviceInfoComboBox::changeEvent(QEvent* event)
{
xToolsComboBox::changeEvent(event);
if ((event->type() == QEvent::EnabledChange) && isEnabled()) {
@ -78,7 +78,7 @@ void xToolsBluetoothDeviceInfoComboBox::changeEvent(QEvent* event)
}
}
void xToolsBluetoothDeviceInfoComboBox::onFinished()
void xToolsBleDeviceInfoComboBox::onFinished()
{
// if (!isEnabled()) {
// return;
@ -94,7 +94,7 @@ void xToolsBluetoothDeviceInfoComboBox::onFinished()
// emit finished();
}
void xToolsBluetoothDeviceInfoComboBox::onDeviceDiscovered(const QBluetoothDeviceInfo& info)
void xToolsBleDeviceInfoComboBox::onDeviceDiscovered(const QBluetoothDeviceInfo& info)
{
if (!isEnabled()) {
return;
@ -103,7 +103,7 @@ void xToolsBluetoothDeviceInfoComboBox::onDeviceDiscovered(const QBluetoothDevic
addItem(info.name(), QVariant::fromValue(info));
}
void xToolsBluetoothDeviceInfoComboBox::onErrorOccurred(const QString& errStr)
void xToolsBleDeviceInfoComboBox::onErrorOccurred(const QString& errStr)
{
QMessageBox::warning(this, tr("Error Occurred"), errStr);
}

View File

@ -13,12 +13,12 @@
#include "xToolsBleScanner.h"
#include "xToolsComboBox.h"
class xToolsBluetoothDeviceInfoComboBox : public xToolsComboBox
class xToolsBleDeviceInfoComboBox : public xToolsComboBox
{
Q_OBJECT
public:
xToolsBluetoothDeviceInfoComboBox(QWidget *parent = Q_NULLPTR);
~xToolsBluetoothDeviceInfoComboBox();
xToolsBleDeviceInfoComboBox(QWidget *parent = Q_NULLPTR);
~xToolsBleDeviceInfoComboBox();
void startDiscover();
void stopDiscover();
bool isActive();

View File

@ -56,11 +56,11 @@ xToolsBleCentralToolUi::xToolsBleCentralToolUi(QWidget* parent)
&QPushButton::clicked,
this,
&xToolsBleCentralToolUi::onPushButtonReadClicked);
connect(ui->comboBoxDevices, &xToolsBluetoothDeviceInfoComboBox::finished, this, [=]() {
connect(ui->comboBoxDevices, &xToolsBleDeviceInfoComboBox::finished, this, [=]() {
ui->pushButtonScan->setText(tr("Scan"));
ui->pushButtonScan->setEnabled(true);
});
connect(ui->comboBoxDevices, &xToolsBluetoothDeviceInfoComboBox::started, this, [=]() {
connect(ui->comboBoxDevices, &xToolsBleDeviceInfoComboBox::started, this, [=]() {
ui->pushButtonScan->setText(tr("Stop"));
ui->pushButtonScan->setEnabled(true);
});