Qt: Fixed endless loop problem with TQtWidgetSet.FocusChanged hook, removed workaround.

git-svn-id: trunk@15043 -
This commit is contained in:
zeljko 2008-05-04 16:14:13 +00:00
parent d2d5ce2407
commit 79f610efff
2 changed files with 4 additions and 6 deletions

View File

@ -329,12 +329,6 @@ begin
end;
if NewWidget <> nil then
begin
// workaround. when form get focus it set focus to ActiveControl
// qt in some cases wants to return focus back to form => we have endless loop
if (NewWidget.LCLObject is TCustomForm) and
(OldWidget <> nil) and
(GetParentForm(OldWidget.LCLObject) = NewWidget.LCLObject) then
Exit;
//WriteLn('SET: ', NewWidget.LCLObject.ClassName);
Msg.msg := LM_SETFOCUS;
Msg.wParam := PtrUInt(OldWidget);

View File

@ -188,7 +188,11 @@ begin
if (TCustomForm(AWinControl).FormStyle in [fsMDIChild]) and
(Application.MainForm.FormStyle = fsMdiForm) and
not (csDesigning in AWinControl.ComponentState) then
begin
QMdiArea_addSubWindow(TQtMainWindow(Application.MainForm.Handle).MDIAreaHandle, QtMainWindow.Widget, QtWindow);
QWidget_setFocusProxy(QtMainWindow.Widget, QtMainWindow.getContainerWidget);
end;
// Return the handle
Result := TLCLIntfHandle(QtMainWindow);