mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 08:58:23 +02:00
Qt,Qt5: fixed changing TMenuItem.ImageIndex inside main menu. issue #37608
This commit is contained in:
parent
31c207d9ed
commit
fcf361530d
@ -398,13 +398,10 @@ end;
|
||||
class procedure TQtWSMenuItem.UpdateMenuIcon(const AMenuItem: TMenuItem;
|
||||
const HasIcon: Boolean; const AIcon: TBitmap);
|
||||
begin
|
||||
if not WSCheckMenuItem(AMenuItem, 'UpdateMenuIcon') then
|
||||
Exit;
|
||||
if AMenuItem.HasParent then
|
||||
begin
|
||||
if HasIcon then
|
||||
TQtMenu(AMenuItem.Handle).setImage(TQtImage(AIcon.Handle))
|
||||
else
|
||||
TQtMenu(AMenuItem.Handle).setImage(nil);
|
||||
end;
|
||||
AMenuItem.RecreateHandle;
|
||||
end;
|
||||
|
||||
{ TQtWSMenu }
|
||||
|
@ -397,13 +397,10 @@ end;
|
||||
class procedure TQtWSMenuItem.UpdateMenuIcon(const AMenuItem: TMenuItem;
|
||||
const HasIcon: Boolean; const AIcon: TBitmap);
|
||||
begin
|
||||
if not WSCheckMenuItem(AMenuItem, 'UpdateMenuIcon') then
|
||||
Exit;
|
||||
if AMenuItem.HasParent then
|
||||
begin
|
||||
if HasIcon then
|
||||
TQtMenu(AMenuItem.Handle).setImage(TQtImage(AIcon.Handle))
|
||||
else
|
||||
TQtMenu(AMenuItem.Handle).setImage(nil);
|
||||
end;
|
||||
AMenuItem.RecreateHandle;
|
||||
end;
|
||||
|
||||
{ TQtWSMenu }
|
||||
|
Loading…
Reference in New Issue
Block a user