mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 04:19:19 +02:00
Qt: fixed wrong TQtWidgetSet.SetParent() behaviour. Flags shouldn't be setted up if form is reparented to other control.
git-svn-id: trunk@30223 -
This commit is contained in:
parent
b48287dbb8
commit
0048e84bad
@ -5021,13 +5021,29 @@ function TQtWidgetSet.SetParent(hWndChild: HWND; hWndParent: HWND): HWND;
|
||||
var
|
||||
OldVisible: Boolean;
|
||||
Flags: QtWindowFlags;
|
||||
W: TQtWidget;
|
||||
begin
|
||||
{$ifdef VerboseQtWinAPI}
|
||||
writeln('[WinApi SetParent] child: ',dbgHex(PtrUInt(hwndChild)),
|
||||
' parent: ',dbgHex(PtrUInt(hWndParent)));
|
||||
{$endif}
|
||||
Result := 0;
|
||||
if not IsValidHandle(hwndChild) then
|
||||
exit;
|
||||
Result := GetParent(hWndChild);
|
||||
OldVisible := TQtWidget(hWndChild).getVisible;
|
||||
Flags := TQtWidget(hWndChild).windowFlags;
|
||||
TQtWidget(hWndChild).setParent(TQtWidget(hWndParent).GetContainerWidget);
|
||||
TQtWidget(hWndChild).setWindowFlags(Flags);
|
||||
TQtWidget(hWndChild).setVisible(OldVisible);
|
||||
if (Result = hwndParent) then
|
||||
exit;
|
||||
W := TQtWidget(hWndChild);
|
||||
OldVisible := W.getVisible;
|
||||
Flags := W.windowFlags;
|
||||
if IsValidHandle(hWndParent) then
|
||||
W.setParent(TQtWidget(hWndParent).GetContainerWidget)
|
||||
else
|
||||
begin
|
||||
W.setParent(nil);
|
||||
W.setWindowFlags(Flags);
|
||||
end;
|
||||
W.setVisible(OldVisible);
|
||||
end;
|
||||
|
||||
function TQtWidgetSet.SetMapMode(DC: HDC; fnMapMode : Integer): Integer;
|
||||
@ -5577,7 +5593,7 @@ var
|
||||
Widget: TQtWidget;
|
||||
begin
|
||||
{$ifdef VerboseQtWinAPI}
|
||||
WriteLn('[WinAPI ShowWindow]');
|
||||
WriteLn('[WinAPI ShowWindow] hwnd ',dbgHex(PtrUInt(hWnd)),' nCmdShow ',nCmdShow);
|
||||
{$endif}
|
||||
|
||||
Result := False;
|
||||
|
Loading…
Reference in New Issue
Block a user