Merge branch '1216-main' into 'dbus-interface'

双击事件仍会触发mousepressevent???

See merge request kylin-desktop/kylin-nm!483
This commit is contained in:
赵 世旭 2021-12-16 03:47:28 +00:00
commit b4b36d8bfd
2 changed files with 6 additions and 2 deletions

View File

@ -1,7 +1,7 @@
#include "drownlabel.h"
#include "deviceframe.h"
#define ICONSIZE 12,12
#define ICONSIZE 16,16
DrownLabel::DrownLabel(QString devName, QWidget * parent) : QLabel(parent)
{
m_devName = devName;

View File

@ -86,6 +86,10 @@ MobileHotspotWidget::~MobileHotspotWidget()
bool MobileHotspotWidget::eventFilter(QObject *watched, QEvent *event)
{
if (event->type() == QEvent::MouseButtonDblClick && watched == m_switchBtn) {
return true;
}
if (event->type() == QEvent::MouseButtonPress) {
if (watched == m_switchBtn) {
if (!m_interface->isValid()) {
@ -97,7 +101,7 @@ bool MobileHotspotWidget::eventFilter(QObject *watched, QEvent *event)
}
if (m_switchBtn->isChecked()) {
showDesktopNotify(tr("start to close hotspot"));
QDBusReply<void> reply = m_interface->call("deactiveWirelessAp", m_apNameLabel->text(), m_uuid);
QDBusReply<void> reply = m_interface->call("deactiveWirelessAp", m_apNameLine->text(), m_uuid);
if (!reply.isValid()) {
qDebug() << "[MobileHotspotWidget] call deactiveWirelessAp failed ";
return true;