From 80592b0e7145fb876ea0e84a6e3dadfd5f7481b6 Mon Sep 17 00:00:00 2001 From: Lauri Laanmets Date: Wed, 8 May 2013 00:11:53 +0300 Subject: Focus gained by mouse click handled correctly now. Task-number: QTSOLBUG-70 Change-Id: Id9cef80728762252542908b4fc62cb1509666da2 Reviewed-by: Friedemann Kleint Reviewed-by: Andy Shaw --- qtwinmigrate/src/qwinwidget.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qtwinmigrate/src/qwinwidget.cpp b/qtwinmigrate/src/qwinwidget.cpp index 167369c..4a04751 100644 --- a/qtwinmigrate/src/qwinwidget.cpp +++ b/qtwinmigrate/src/qwinwidget.cpp @@ -261,7 +261,9 @@ bool QWinWidget::winEvent(MSG *msg, long *) #endif if (msg->message == WM_SETFOCUS) { Qt::FocusReason reason; - if (::GetKeyState(VK_SHIFT) < 0) + if (::GetKeyState(VK_LBUTTON) < 0 || ::GetKeyState(VK_RBUTTON) < 0) + reason = Qt::MouseFocusReason; + else if (::GetKeyState(VK_SHIFT) < 0) reason = Qt::BacktabFocusReason; else reason = Qt::TabFocusReason; -- cgit v1.2.3