not focus popup tips if not model

Change-Id: I6a00e6e032395208b4812a3eef68cd9d70580fae
This commit is contained in:
石博文 2016-09-07 09:50:42 +08:00
parent 6736c67dab
commit 589b0b1526
Notes: Deepin Code Review 2016-09-07 05:43:08 +00:00
Verified+1: Anonymous Coward #1000004
Code-Review+2: 石博文 <sbw@sbw.so>
Submitted-by: 石博文 <sbw@sbw.so>
Submitted-at: Wed, 07 Sep 2016 05:43:08 +0000
Reviewed-on: https://cr.deepin.io/15909
Project: dde/dde-dock
Branch: refs/heads/master

View File

@ -76,6 +76,8 @@ void DockPopupWindow::showEvent(QShowEvent *e)
QTimer::singleShot(1, this, [&] {
raise();
if (!m_model)
return;
activateWindow();
setFocus(Qt::ActiveWindowFocusReason);
});
@ -86,6 +88,8 @@ void DockPopupWindow::enterEvent(QEvent *e)
DArrowRectangle::enterEvent(e);
raise();
if (!m_model)
return;
activateWindow();
setFocus(Qt::ActiveWindowFocusReason);
}