mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 11:39:28 +02:00
parent
8b04de8ad2
commit
c98da657b9
@ -177,6 +177,7 @@ type
|
||||
// qt hints handles map (needed on X11 only)
|
||||
procedure AddHintHandle(AHandle: TObject);
|
||||
procedure RemoveHintHandle(AHandle: TObject);
|
||||
procedure RemoveAllHintsHandles;
|
||||
function IsValidHintHandle(AHandle: TObject): Boolean;
|
||||
procedure HideAllHints;
|
||||
procedure RestoreAllHints;
|
||||
|
@ -1435,6 +1435,37 @@ begin
|
||||
System.LeaveCriticalsection(CriticalSection);
|
||||
end;
|
||||
|
||||
procedure TQtWidgetSet.RemoveAllHintsHandles;
|
||||
var
|
||||
i: Integer;
|
||||
AWidget: TQtHintWindow;
|
||||
begin
|
||||
System.EnterCriticalsection(CriticalSection);
|
||||
try
|
||||
if not Assigned(SavedHintHandlesList) then
|
||||
exit;
|
||||
for i := SavedHintHandlesList.Count - 1 downto 0 do
|
||||
begin
|
||||
if IsValidHintHandle(TObject(SavedHintHandlesList.Items[i])) then
|
||||
begin
|
||||
AWidget := TQtHintWindow(SavedHintHandlesList.Items[i]);
|
||||
if Assigned(AWidget.LCLObject) and (AWidget.LCLObject.Parent = nil) and
|
||||
(AWidget.LCLObject is THintWindow) then
|
||||
begin
|
||||
AWidget.BeginUpdate;
|
||||
AWidget.LCLObject.Visible := False;
|
||||
AWidget.Hide;
|
||||
AWidget.EndUpdate;
|
||||
AWidget.setParent(nil);
|
||||
THintWindow(AWidget.LCLObject).ReleaseHandle;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
finally
|
||||
System.LeaveCriticalsection(CriticalSection);
|
||||
end;
|
||||
end;
|
||||
|
||||
function TQtWidgetSet.IsValidHintHandle(AHandle: TObject): Boolean;
|
||||
begin
|
||||
if (AHandle = nil) then
|
||||
|
@ -18312,10 +18312,9 @@ begin
|
||||
if AParams.WndParent <> 0 then
|
||||
Parent := TQtWidget(AParams.WndParent).GetContainerWidget
|
||||
else
|
||||
{issue #36773
|
||||
if QApplication_activeModalWidget <> nil then
|
||||
Parent := QApplication_activeModalWidget
|
||||
else}
|
||||
else
|
||||
Parent := nil;
|
||||
Result := QWidget_create(Parent, QtToolTip);
|
||||
FDeleteLater := True;
|
||||
|
@ -282,7 +282,8 @@ end;
|
||||
class procedure TQtWSWinControl.GetPreferredSize(const AWinControl: TWinControl;
|
||||
var PreferredWidth, PreferredHeight: integer; WithThemeSpace: Boolean);
|
||||
begin
|
||||
Assert(AWinControl.HandleAllocated, 'GetPreferredSize: Handle not allocated');
|
||||
if not WSCheckHandleAllocated(AWinControl, 'GetPreferredSize') then
|
||||
Exit;
|
||||
TQtWidget(AWinControl.Handle).PreferredSize(PreferredWidth, PreferredHeight, WithThemeSpace);
|
||||
end;
|
||||
|
||||
|
@ -265,6 +265,11 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
class procedure TQtWSCustomForm.CloseModal(const ACustomForm: TCustomForm);
|
||||
begin
|
||||
{issue #36773}
|
||||
{$IFDEF HASX11}
|
||||
Application.CancelHint;
|
||||
QtWidgetSet.RemoveAllHintsHandles;
|
||||
{$ENDIF}
|
||||
inherited CloseModal(ACustomForm);
|
||||
end;
|
||||
|
||||
@ -662,6 +667,11 @@ end;
|
||||
------------------------------------------------------------------------------}
|
||||
class procedure TQtWSCustomForm.ShowModal(const ACustomForm: TCustomForm);
|
||||
begin
|
||||
{issue #36773}
|
||||
{$IFDEF HASX11}
|
||||
Application.CancelHint;
|
||||
QtWidgetSet.RemoveAllHintsHandles;
|
||||
{$ENDIF}
|
||||
{
|
||||
Setting modal flags is done in TQtWSCustomControl.ShowHide
|
||||
Since that flags has effect only when Widget is not visible
|
||||
|
Loading…
Reference in New Issue
Block a user