mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-04 03:40:28 +02:00
Qt: fixed crash in TQtTrayIcon during animate (imagelist). issue #20717
git-svn-id: trunk@33661 -
This commit is contained in:
parent
ee10755fa9
commit
0c5bf06d0c
@ -296,15 +296,32 @@ end;
|
|||||||
class procedure TQtWSCustomTrayIcon.InternalUpdate(const ATrayIcon: TCustomTrayIcon);
|
class procedure TQtWSCustomTrayIcon.InternalUpdate(const ATrayIcon: TCustomTrayIcon);
|
||||||
var
|
var
|
||||||
SystemTrayIcon: TQtSystemTrayIcon;
|
SystemTrayIcon: TQtSystemTrayIcon;
|
||||||
|
AIcon: QIconH;
|
||||||
begin
|
begin
|
||||||
if (ATrayIcon.Handle = 0) then Exit;
|
if (ATrayIcon.Handle = 0) then Exit;
|
||||||
|
|
||||||
SystemTrayIcon := TQtSystemTrayIcon(ATrayIcon.Handle);
|
SystemTrayIcon := TQtSystemTrayIcon(ATrayIcon.Handle);
|
||||||
|
if Assigned(ATrayIcon.Icon) then
|
||||||
if Assigned(ATrayIcon.Icon) and (ATrayIcon.Icon.HandleAllocated) then
|
begin
|
||||||
SystemTrayIcon.setIcon(TQtIcon(ATrayIcon.Icon.Handle).Handle)
|
// normal icon
|
||||||
else
|
if (ATrayIcon.Icon.HandleAllocated) then
|
||||||
SystemTrayIcon.setIcon(nil);
|
SystemTrayIcon.setIcon(TQtIcon(ATrayIcon.Icon.Handle).Handle)
|
||||||
|
else
|
||||||
|
// image list (animate)
|
||||||
|
if (ATrayIcon.Icon.BitmapHandle <> 0) then
|
||||||
|
SystemTrayIcon.setIcon(TQtImage(ATrayIcon.Icon.BitmapHandle).AsIcon)
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
AIcon := QIcon_create;
|
||||||
|
SystemTrayIcon.setIcon(AIcon);
|
||||||
|
QIcon_destroy(AIcon);
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
AIcon := QIcon_create;
|
||||||
|
SystemTrayIcon.setIcon(AIcon);
|
||||||
|
QIcon_destroy(AIcon);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{ PopUpMenu }
|
{ PopUpMenu }
|
||||||
|
Loading…
Reference in New Issue
Block a user