Skip to content

Commit 80592b0

Browse files
author
Lauri Laanmets
committed
Focus gained by mouse click handled correctly now.
Task-number: QTSOLBUG-70 Change-Id: Id9cef80728762252542908b4fc62cb1509666da2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Andy Shaw <andy.shaw@digia.com>
1 parent 4ac9775 commit 80592b0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

qtwinmigrate/src/qwinwidget.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,9 @@ bool QWinWidget::winEvent(MSG *msg, long *)
261261
#endif
262262
if (msg->message == WM_SETFOCUS) {
263263
Qt::FocusReason reason;
264-
if (::GetKeyState(VK_SHIFT) < 0)
264+
if (::GetKeyState(VK_LBUTTON) < 0 || ::GetKeyState(VK_RBUTTON) < 0)
265+
reason = Qt::MouseFocusReason;
266+
else if (::GetKeyState(VK_SHIFT) < 0)
265267
reason = Qt::BacktabFocusReason;
266268
else
267269
reason = Qt::TabFocusReason;

0 commit comments

Comments
 (0)