mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 03:35:57 +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);
|
procedure TQtWidgetSet.AppSetIcon(const AIcon: HICON);
|
||||||
var
|
var
|
||||||
Icon: TQtIcon;
|
DoDestroyIcon: Boolean;
|
||||||
|
Icon: QIconH;
|
||||||
begin
|
begin
|
||||||
Icon := TQtIcon(AIcon);
|
DoDestroyIcon := AIcon = 0;
|
||||||
if Icon <> nil then
|
if DoDestroyIcon then
|
||||||
QApplication_setWindowIcon(Icon.Handle)
|
Icon := QIcon_create()
|
||||||
else
|
else
|
||||||
QApplication_setWindowIcon(nil);
|
Icon := TQtIcon(AIcon).Handle;
|
||||||
|
QApplication_setWindowIcon(Icon);
|
||||||
|
if DoDestroyIcon then
|
||||||
|
QIcon_destroy(Icon);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -2751,8 +2751,15 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TQtWidget.setWindowIcon(AIcon: QIconH);
|
procedure TQtWidget.setWindowIcon(AIcon: QIconH);
|
||||||
|
var
|
||||||
|
DestroyIcon: Boolean;
|
||||||
begin
|
begin
|
||||||
|
DestroyIcon := AIcon = nil;
|
||||||
|
if DestroyIcon then
|
||||||
|
AIcon := QIcon_create();
|
||||||
QWidget_setWindowIcon(Widget, AIcon);
|
QWidget_setWindowIcon(Widget, AIcon);
|
||||||
|
if DestroyIcon then
|
||||||
|
QIcon_destroy(AIcon);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TQtWidget.windowFlags: QtWindowFlags;
|
function TQtWidget.windowFlags: QtWindowFlags;
|
||||||
|
Loading…
Reference in New Issue
Block a user