fix:Do not drag when tray icon is deleted

托盘图标删除时取消拖拽状态       (task:13009)
This commit is contained in:
chenzhe 2019-12-27 15:40:50 +08:00
parent 660a740a05
commit 2f866675cc
3 changed files with 15 additions and 0 deletions

View File

@ -69,6 +69,9 @@ bool AbstractContainer::removeWrapper(FashionTrayWidgetWrapper *wrapper)
if (!w->absTrayWidget().isNull())
w->absTrayWidget()->setParent(nullptr);
if (w->isDragging()) {
w->cancelDragging();
}
w->deleteLater();
refreshVisible();

View File

@ -265,3 +265,13 @@ void FashionTrayWidgetWrapper::setAttention(bool attention)
Q_EMIT attentionChanged(m_attention);
}
bool FashionTrayWidgetWrapper::isDragging()
{
return m_dragging;
}
void FashionTrayWidgetWrapper::cancelDragging()
{
QDrag::cancel();
}

View File

@ -41,6 +41,8 @@ public:
bool attention() const;
void setAttention(bool attention);
bool isDragging();
void cancelDragging();
Q_SIGNALS:
void attentionChanged(const bool attention);