free pointer

This commit is contained in:
kangshuning 2021-10-27 17:36:20 +08:00
parent 22e3fcc575
commit a7d8d2f28f
3 changed files with 8 additions and 3 deletions

View File

@ -26,7 +26,7 @@ LanListItem::LanListItem(const KyConnectItem *lanConnectItem,
m_itemFrame->installEventFilter(this);
connect(this->m_infoButton, &InfoButton::clicked, this, &LanListItem::onInfoButtonClicked);
m_menu = new QMenu();//右键菜单
m_menu = new QMenu(this);//右键菜单
connect(m_menu, &QMenu::triggered, this, &LanListItem::onMenuTriggered);
}
@ -41,6 +41,11 @@ LanListItem::LanListItem(QWidget *parent) : ListItem(parent)
this->m_infoButton->hide();
}
LanListItem::~LanListItem()
{
qDebug()<<"[LanPage] lan list item is deleted." << m_lanConnectItem.m_connectName;
}
void LanListItem::setIcon(bool isOn)
{
if (isOn) {

View File

@ -16,7 +16,7 @@ public:
LanListItem(const KyConnectItem *lanConnectItem, const QString &deviceName, QWidget *parent = nullptr);
LanListItem(QWidget *parent = nullptr);
~LanListItem() = default;
~LanListItem();
public:
void updateConnectionState(ConnectState state);

View File

@ -18,7 +18,7 @@ WlanListItem::WlanListItem(KyWirelessNetItem &wirelessNetItem, QString device, Q
connect(this->m_infoButton, &InfoButton::clicked, this, &WlanListItem::onInfoButtonClicked);
m_menu = new QMenu();//右键菜单
m_menu = new QMenu(this);//右键菜单
connect(m_menu, &QMenu::triggered, this, &WlanListItem::onMenuTriggered);
m_wirelessConnectOperation = new KyWirelessConnectOperation(this);