1
0
mirror of https://github.com/jaredtao/TaoQuick.git synced 2025-02-06 21:48:24 +08:00
2020-12-08 11:20:55 +08:00

25 lines
662 B
C++

#include "DeviceAddItem.h"
#include <QHostAddress>
DeviceAddItem::DeviceAddItem(QObject *parent) : TaoListItemBase(parent)
{
connect(this, &DeviceAddItem::addressChanged, this, [this]() { m_ipv4Address = QHostAddress(address()).toIPv4Address(); });
}
DeviceAddItem::~DeviceAddItem() { }
bool DeviceAddItem::match(const QString &key)
{
if (key.isEmpty()) {
return true;
}
if (m_name.contains(key, Qt::CaseInsensitive)) {
return true;
}
if (m_address.contains(key, Qt::CaseInsensitive)) {
return true;
}
if (m_modelString.contains(key, Qt::CaseInsensitive)) {
return true;
}
return false;
}