mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-23 05:19:27 +02:00
Qt, Qt5: fix crash if glyph is available but hidden with ShowMode
git-svn-id: trunk@57921 -
This commit is contained in:
parent
04805d25f4
commit
1687a7b56a
@ -199,7 +199,7 @@ type
|
|||||||
procedure LoadGlyphFromResourceName(Instance: THandle; const AName: String);
|
procedure LoadGlyphFromResourceName(Instance: THandle; const AName: String);
|
||||||
procedure LoadGlyphFromLazarusResource(const AName: String);
|
procedure LoadGlyphFromLazarusResource(const AName: String);
|
||||||
procedure LoadGlyphFromStock(idButton: Integer);
|
procedure LoadGlyphFromStock(idButton: Integer);
|
||||||
function CanShowGlyph: Boolean;
|
function CanShowGlyph(const AWithShowMode: Boolean = False): Boolean;
|
||||||
public
|
public
|
||||||
property Caption stored IsCaptionStored;
|
property Caption stored IsCaptionStored;
|
||||||
property DefaultCaption: Boolean read FDefaultCaption write FDefaultCaption default False;
|
property DefaultCaption: Boolean read FDefaultCaption write FDefaultCaption default False;
|
||||||
|
@ -90,9 +90,11 @@ begin
|
|||||||
Images := nil;
|
Images := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomBitBtn.CanShowGlyph: Boolean;
|
function TCustomBitBtn.CanShowGlyph(const AWithShowMode: Boolean): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := FButtonGlyph.CanShowGlyph;
|
Result := FButtonGlyph.CanShowGlyph;
|
||||||
|
if AWithShowMode then
|
||||||
|
Result := Result and FButtonGlyph.CanShow;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomBitBtn.GetGlyph : TBitmap;
|
function TCustomBitBtn.GetGlyph : TBitmap;
|
||||||
|
@ -99,7 +99,7 @@ begin
|
|||||||
|
|
||||||
TQtBitBtn(ABitBtn.Handle).GlyphLayout := Ord(ABitBtn.Layout);
|
TQtBitBtn(ABitBtn.Handle).GlyphLayout := Ord(ABitBtn.Layout);
|
||||||
AIcon := QIcon_create();
|
AIcon := QIcon_create();
|
||||||
if ABitBtn.CanShowGlyph then
|
if ABitBtn.CanShowGlyph(True) then
|
||||||
begin
|
begin
|
||||||
AGlyph := TBitmap.Create;
|
AGlyph := TBitmap.Create;
|
||||||
APixmap := QPixmap_create();
|
APixmap := QPixmap_create();
|
||||||
|
@ -98,7 +98,7 @@ begin
|
|||||||
|
|
||||||
TQtBitBtn(ABitBtn.Handle).GlyphLayout := Ord(ABitBtn.Layout);
|
TQtBitBtn(ABitBtn.Handle).GlyphLayout := Ord(ABitBtn.Layout);
|
||||||
AIcon := QIcon_create();
|
AIcon := QIcon_create();
|
||||||
if ABitBtn.CanShowGlyph then
|
if ABitBtn.CanShowGlyph(True) then
|
||||||
begin
|
begin
|
||||||
AGlyph := TBitmap.Create;
|
AGlyph := TBitmap.Create;
|
||||||
APixmap := QPixmap_create();
|
APixmap := QPixmap_create();
|
||||||
|
Loading…
Reference in New Issue
Block a user