Qt: fix focus patch, qtwin32 doesn'' like it.

git-svn-id: trunk@16283 -
This commit is contained in:
zeljko 2008-08-28 13:12:15 +00:00
parent f3be183c27
commit a5bf37a4f3

View File

@ -4168,8 +4168,17 @@ begin
WriteLn('********* TQtWidgetSet.SetFocus INIT focusing ', TQtWidget(hwnd).lclobject.name);
{$endif}
result := GetFocus;
if Result <> 0 then
{apply clearFocus only to X11 & Mac,
qt win32 doesn't like this}
{$IFDEF UNIX}
if (Result <> 0) and not
((TQtWidget(Hwnd) is TQtMainWindow) or
(TQtWidget(Result) is TQtMainWindow))
then
QWidget_clearFocus(TQtWidget(Result).Widget);
{$ENDIF}
TQtWidget(hWnd).setFocus;
{$ifdef VerboseFocus}
DebugLn('********* TQtWidgetSet.SetFocus END was %x now is %x',[result,hwnd]);