mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 20:19:16 +02:00
Qt: enable wordwrap on TQtStaticText. issue #21697
git-svn-id: trunk@36711 -
This commit is contained in:
parent
d052d54817
commit
c5accacd74
@ -648,6 +648,8 @@ type
|
|||||||
|
|
||||||
TQtStaticText = class(TQtFrame)
|
TQtStaticText = class(TQtFrame)
|
||||||
private
|
private
|
||||||
|
function GetWordWrap: Boolean;
|
||||||
|
procedure SetWordWrap(AValue: Boolean);
|
||||||
protected
|
protected
|
||||||
function CreateWidget(const AParams: TCreateParams):QWidgetH; override;
|
function CreateWidget(const AParams: TCreateParams):QWidgetH; override;
|
||||||
public
|
public
|
||||||
@ -655,6 +657,7 @@ type
|
|||||||
function getText: WideString; override;
|
function getText: WideString; override;
|
||||||
procedure setText(const W: WideString); override;
|
procedure setText(const W: WideString); override;
|
||||||
procedure setAlignment(const AAlignment: QtAlignment);
|
procedure setAlignment(const AAlignment: QtAlignment);
|
||||||
|
property WordWrap: Boolean read GetWordWrap write SetWordWrap;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TQtCheckBox }
|
{ TQtCheckBox }
|
||||||
@ -6480,6 +6483,16 @@ end;
|
|||||||
|
|
||||||
{ TQtStaticText }
|
{ TQtStaticText }
|
||||||
|
|
||||||
|
function TQtStaticText.GetWordWrap: Boolean;
|
||||||
|
begin
|
||||||
|
Result := QLabel_wordWrap(QLabelH(Widget));
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TQtStaticText.SetWordWrap(AValue: Boolean);
|
||||||
|
begin
|
||||||
|
QLabel_setWordWrap(QLabelH(Widget), AValue);
|
||||||
|
end;
|
||||||
|
|
||||||
function TQtStaticText.CreateWidget(const AParams: TCreateParams): QWidgetH;
|
function TQtStaticText.CreateWidget(const AParams: TCreateParams): QWidgetH;
|
||||||
var
|
var
|
||||||
Parent: QWidgetH;
|
Parent: QWidgetH;
|
||||||
|
@ -1069,8 +1069,8 @@ var
|
|||||||
QtStaticText: TQtStaticText;
|
QtStaticText: TQtStaticText;
|
||||||
begin
|
begin
|
||||||
QtStaticText := TQtStaticText.Create(AWinControl, AParams);
|
QtStaticText := TQtStaticText.Create(AWinControl, AParams);
|
||||||
|
QtStaticText.WordWrap := True;
|
||||||
QtStaticText.AttachEvents;
|
QtStaticText.AttachEvents;
|
||||||
|
|
||||||
QtStaticText.setAlignment(AlignmentMap[TCustomStaticText(AWinControl).Alignment]);
|
QtStaticText.setAlignment(AlignmentMap[TCustomStaticText(AWinControl).Alignment]);
|
||||||
QtStaticText.setFrameShape(StaticBorderFrameShapeMap[TCustomStaticText(AWinControl).BorderStyle]);
|
QtStaticText.setFrameShape(StaticBorderFrameShapeMap[TCustomStaticText(AWinControl).BorderStyle]);
|
||||||
QtStaticText.setFrameShadow(StaticBorderFrameShadowMap[TCustomStaticText(AWinControl).BorderStyle]);
|
QtStaticText.setFrameShadow(StaticBorderFrameShadowMap[TCustomStaticText(AWinControl).BorderStyle]);
|
||||||
|
Loading…
Reference in New Issue
Block a user