mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 22:19:18 +02:00
parent
8b04de8ad2
commit
c98da657b9
@ -177,6 +177,7 @@ type
|
|||||||
// qt hints handles map (needed on X11 only)
|
// qt hints handles map (needed on X11 only)
|
||||||
procedure AddHintHandle(AHandle: TObject);
|
procedure AddHintHandle(AHandle: TObject);
|
||||||
procedure RemoveHintHandle(AHandle: TObject);
|
procedure RemoveHintHandle(AHandle: TObject);
|
||||||
|
procedure RemoveAllHintsHandles;
|
||||||
function IsValidHintHandle(AHandle: TObject): Boolean;
|
function IsValidHintHandle(AHandle: TObject): Boolean;
|
||||||
procedure HideAllHints;
|
procedure HideAllHints;
|
||||||
procedure RestoreAllHints;
|
procedure RestoreAllHints;
|
||||||
|
@ -1435,6 +1435,37 @@ begin
|
|||||||
System.LeaveCriticalsection(CriticalSection);
|
System.LeaveCriticalsection(CriticalSection);
|
||||||
end;
|
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;
|
function TQtWidgetSet.IsValidHintHandle(AHandle: TObject): Boolean;
|
||||||
begin
|
begin
|
||||||
if (AHandle = nil) then
|
if (AHandle = nil) then
|
||||||
|
@ -18312,10 +18312,9 @@ begin
|
|||||||
if AParams.WndParent <> 0 then
|
if AParams.WndParent <> 0 then
|
||||||
Parent := TQtWidget(AParams.WndParent).GetContainerWidget
|
Parent := TQtWidget(AParams.WndParent).GetContainerWidget
|
||||||
else
|
else
|
||||||
{issue #36773
|
|
||||||
if QApplication_activeModalWidget <> nil then
|
if QApplication_activeModalWidget <> nil then
|
||||||
Parent := QApplication_activeModalWidget
|
Parent := QApplication_activeModalWidget
|
||||||
else}
|
else
|
||||||
Parent := nil;
|
Parent := nil;
|
||||||
Result := QWidget_create(Parent, QtToolTip);
|
Result := QWidget_create(Parent, QtToolTip);
|
||||||
FDeleteLater := True;
|
FDeleteLater := True;
|
||||||
|
@ -282,7 +282,8 @@ end;
|
|||||||
class procedure TQtWSWinControl.GetPreferredSize(const AWinControl: TWinControl;
|
class procedure TQtWSWinControl.GetPreferredSize(const AWinControl: TWinControl;
|
||||||
var PreferredWidth, PreferredHeight: integer; WithThemeSpace: Boolean);
|
var PreferredWidth, PreferredHeight: integer; WithThemeSpace: Boolean);
|
||||||
begin
|
begin
|
||||||
Assert(AWinControl.HandleAllocated, 'GetPreferredSize: Handle not allocated');
|
if not WSCheckHandleAllocated(AWinControl, 'GetPreferredSize') then
|
||||||
|
Exit;
|
||||||
TQtWidget(AWinControl.Handle).PreferredSize(PreferredWidth, PreferredHeight, WithThemeSpace);
|
TQtWidget(AWinControl.Handle).PreferredSize(PreferredWidth, PreferredHeight, WithThemeSpace);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -265,6 +265,11 @@ end;
|
|||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
class procedure TQtWSCustomForm.CloseModal(const ACustomForm: TCustomForm);
|
class procedure TQtWSCustomForm.CloseModal(const ACustomForm: TCustomForm);
|
||||||
begin
|
begin
|
||||||
|
{issue #36773}
|
||||||
|
{$IFDEF HASX11}
|
||||||
|
Application.CancelHint;
|
||||||
|
QtWidgetSet.RemoveAllHintsHandles;
|
||||||
|
{$ENDIF}
|
||||||
inherited CloseModal(ACustomForm);
|
inherited CloseModal(ACustomForm);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -662,6 +667,11 @@ end;
|
|||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
class procedure TQtWSCustomForm.ShowModal(const ACustomForm: TCustomForm);
|
class procedure TQtWSCustomForm.ShowModal(const ACustomForm: TCustomForm);
|
||||||
begin
|
begin
|
||||||
|
{issue #36773}
|
||||||
|
{$IFDEF HASX11}
|
||||||
|
Application.CancelHint;
|
||||||
|
QtWidgetSet.RemoveAllHintsHandles;
|
||||||
|
{$ENDIF}
|
||||||
{
|
{
|
||||||
Setting modal flags is done in TQtWSCustomControl.ShowHide
|
Setting modal flags is done in TQtWSCustomControl.ShowHide
|
||||||
Since that flags has effect only when Widget is not visible
|
Since that flags has effect only when Widget is not visible
|
||||||
|
Loading…
Reference in New Issue
Block a user