mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 20:59:12 +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
|
var
|
||||||
OldVisible: Boolean;
|
OldVisible: Boolean;
|
||||||
Flags: QtWindowFlags;
|
Flags: QtWindowFlags;
|
||||||
|
W: TQtWidget;
|
||||||
begin
|
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);
|
Result := GetParent(hWndChild);
|
||||||
OldVisible := TQtWidget(hWndChild).getVisible;
|
if (Result = hwndParent) then
|
||||||
Flags := TQtWidget(hWndChild).windowFlags;
|
exit;
|
||||||
TQtWidget(hWndChild).setParent(TQtWidget(hWndParent).GetContainerWidget);
|
W := TQtWidget(hWndChild);
|
||||||
TQtWidget(hWndChild).setWindowFlags(Flags);
|
OldVisible := W.getVisible;
|
||||||
TQtWidget(hWndChild).setVisible(OldVisible);
|
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;
|
end;
|
||||||
|
|
||||||
function TQtWidgetSet.SetMapMode(DC: HDC; fnMapMode : Integer): Integer;
|
function TQtWidgetSet.SetMapMode(DC: HDC; fnMapMode : Integer): Integer;
|
||||||
@ -5577,7 +5593,7 @@ var
|
|||||||
Widget: TQtWidget;
|
Widget: TQtWidget;
|
||||||
begin
|
begin
|
||||||
{$ifdef VerboseQtWinAPI}
|
{$ifdef VerboseQtWinAPI}
|
||||||
WriteLn('[WinAPI ShowWindow]');
|
WriteLn('[WinAPI ShowWindow] hwnd ',dbgHex(PtrUInt(hWnd)),' nCmdShow ',nCmdShow);
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
Result := False;
|
Result := False;
|
||||||
|
Loading…
Reference in New Issue
Block a user