mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 20:28:19 +02:00
qt: correctly handle HICON = 0
git-svn-id: trunk@15502 -
This commit is contained in:
parent
453ea8d582
commit
f4e7288ff8
@ -219,13 +219,17 @@ end;
|
||||
|
||||
procedure TQtWidgetSet.AppSetIcon(const AIcon: HICON);
|
||||
var
|
||||
Icon: TQtIcon;
|
||||
DoDestroyIcon: Boolean;
|
||||
Icon: QIconH;
|
||||
begin
|
||||
Icon := TQtIcon(AIcon);
|
||||
if Icon <> nil then
|
||||
QApplication_setWindowIcon(Icon.Handle)
|
||||
DoDestroyIcon := AIcon = 0;
|
||||
if DoDestroyIcon then
|
||||
Icon := QIcon_create()
|
||||
else
|
||||
QApplication_setWindowIcon(nil);
|
||||
Icon := TQtIcon(AIcon).Handle;
|
||||
QApplication_setWindowIcon(Icon);
|
||||
if DoDestroyIcon then
|
||||
QIcon_destroy(Icon);
|
||||
end;
|
||||
|
||||
|
||||
|
@ -2751,8 +2751,15 @@ begin
|
||||
end;
|
||||
|
||||
procedure TQtWidget.setWindowIcon(AIcon: QIconH);
|
||||
var
|
||||
DestroyIcon: Boolean;
|
||||
begin
|
||||
DestroyIcon := AIcon = nil;
|
||||
if DestroyIcon then
|
||||
AIcon := QIcon_create();
|
||||
QWidget_setWindowIcon(Widget, AIcon);
|
||||
if DestroyIcon then
|
||||
QIcon_destroy(AIcon);
|
||||
end;
|
||||
|
||||
function TQtWidget.windowFlags: QtWindowFlags;
|
||||
|
Loading…
Reference in New Issue
Block a user