From 11056d43f5af05df4441f700ef099791915a20cf Mon Sep 17 00:00:00 2001 From: "songwentao@uniontech.com" Date: Wed, 28 Sep 2022 11:21:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=93=9D=E7=89=99?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E8=BF=9E=E6=8E=A5=E5=90=8E=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除QStandardItem后,与其绑定的DViewItemAction对象的geometry没有变化导致还显示在原位置 修复方案是:手动更新action的位置,后期DTK组会针对该问题进行优化。 Log: Influence: 任务栏-蓝牙列表-连接后,列表正常显示 Bug: https://pms.uniontech.com/bug-view-159331.html --- .../bluetooth/componments/bluetoothadapteritem.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/bluetooth/componments/bluetoothadapteritem.cpp b/plugins/bluetooth/componments/bluetoothadapteritem.cpp index 5ed51b308..2375c0cbd 100644 --- a/plugins/bluetooth/componments/bluetoothadapteritem.cpp +++ b/plugins/bluetooth/componments/bluetoothadapteritem.cpp @@ -115,15 +115,16 @@ void BluetoothDeviceItem::updateDeviceState(Device::State state) } else if (state == Device::StateConnected) { m_loading->stop(); emit requestTopDeviceItem(m_standarditem); + + /* 已连接的Item插入到首位后,其设置的 DViewItemAction 对象的位置未更新,导致还是显示在原位置 + 手动设置其位置到首位,触发 DViewItemAction 对象的位置更新,规避该问题,该问题待后期DTK优化 */ + QRect loadingRect = m_loading->geometry(); + loadingRect.setY(0); + m_loading->setGeometry(loadingRect); } else { m_loading->stop(); } - /* 已连接的Item插入到首位后,其设置的 DViewItemAction 对象的位置未更新,导致还是显示在原位置 - 手动设置其位置到首位,触发 DViewItemAction 对象的位置更新,规避该问题,该问题待后期DTK优化 */ - QRect loadingRect = m_loading->geometry(); - loadingRect.setY(0); - m_loading->setGeometry(loadingRect); emit deviceStateChanged(m_device); }