mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-11 17:20:56 +01:00
qt,qt5: fixed av because parent can be nil. issue #31684
git-svn-id: trunk@54654 -
This commit is contained in:
parent
c954ed4518
commit
4dddd8003a
@ -632,7 +632,7 @@ begin
|
||||
if AWinControl.HandleObjectShouldBeVisible and
|
||||
(LowerCase(AWinControl.Font.Name) = 'default') then
|
||||
begin
|
||||
if AWinControl.IsParentFont then
|
||||
if AWinControl.IsParentFont and Assigned(AWinControl.Parent) then
|
||||
SetFont(AWinControl, AWinControl.Parent.Font) {DO NOT TOUCH THIS PLEASE !}
|
||||
else
|
||||
SetFont(AWinControl, AWinControl.Font); {DO NOT TOUCH THIS PLEASE !}
|
||||
|
||||
@ -625,12 +625,17 @@ begin
|
||||
Exit;
|
||||
|
||||
Widget := TQtWidget(AWinControl.Handle);
|
||||
|
||||
Widget.BeginUpdate;
|
||||
// issue #28437
|
||||
if AWinControl.HandleObjectShouldBeVisible and not AWinControl.IsParentFont and
|
||||
(AWinControl.Font.Name = 'default') then
|
||||
SetFont(AWinControl, AWinControl.Font);
|
||||
// issue #28437, #30966 - regression from r53365: when FontChanged() is called
|
||||
// here handle is recreated inside LCL, so we are dead - SEGFAULT.
|
||||
if AWinControl.HandleObjectShouldBeVisible and
|
||||
(LowerCase(AWinControl.Font.Name) = 'default') then
|
||||
begin
|
||||
if AWinControl.IsParentFont and Assigned(AWinControl.Parent) then
|
||||
SetFont(AWinControl, AWinControl.Parent.Font) {DO NOT TOUCH THIS PLEASE !}
|
||||
else
|
||||
SetFont(AWinControl, AWinControl.Font); {DO NOT TOUCH THIS PLEASE !}
|
||||
end;
|
||||
|
||||
Widget.setVisible(AWinControl.HandleObjectShouldBeVisible);
|
||||
Widget.EndUpdate;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user