mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-21 12:19:14 +02:00
Qt: Fixed endless loop problem with TQtWidgetSet.FocusChanged hook, removed workaround.
git-svn-id: trunk@15043 -
This commit is contained in:
parent
d2d5ce2407
commit
79f610efff
@ -329,12 +329,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
if NewWidget <> nil then
|
if NewWidget <> nil then
|
||||||
begin
|
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);
|
//WriteLn('SET: ', NewWidget.LCLObject.ClassName);
|
||||||
Msg.msg := LM_SETFOCUS;
|
Msg.msg := LM_SETFOCUS;
|
||||||
Msg.wParam := PtrUInt(OldWidget);
|
Msg.wParam := PtrUInt(OldWidget);
|
||||||
|
@ -188,7 +188,11 @@ begin
|
|||||||
if (TCustomForm(AWinControl).FormStyle in [fsMDIChild]) and
|
if (TCustomForm(AWinControl).FormStyle in [fsMDIChild]) and
|
||||||
(Application.MainForm.FormStyle = fsMdiForm) and
|
(Application.MainForm.FormStyle = fsMdiForm) and
|
||||||
not (csDesigning in AWinControl.ComponentState) then
|
not (csDesigning in AWinControl.ComponentState) then
|
||||||
|
begin
|
||||||
QMdiArea_addSubWindow(TQtMainWindow(Application.MainForm.Handle).MDIAreaHandle, QtMainWindow.Widget, QtWindow);
|
QMdiArea_addSubWindow(TQtMainWindow(Application.MainForm.Handle).MDIAreaHandle, QtMainWindow.Widget, QtWindow);
|
||||||
|
QWidget_setFocusProxy(QtMainWindow.Widget, QtMainWindow.getContainerWidget);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
// Return the handle
|
// Return the handle
|
||||||
Result := TLCLIntfHandle(QtMainWindow);
|
Result := TLCLIntfHandle(QtMainWindow);
|
||||||
|
Loading…
Reference in New Issue
Block a user