mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 03:56:12 +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)
|
||||
private
|
||||
function GetWordWrap: Boolean;
|
||||
procedure SetWordWrap(AValue: Boolean);
|
||||
protected
|
||||
function CreateWidget(const AParams: TCreateParams):QWidgetH; override;
|
||||
public
|
||||
@ -655,6 +657,7 @@ type
|
||||
function getText: WideString; override;
|
||||
procedure setText(const W: WideString); override;
|
||||
procedure setAlignment(const AAlignment: QtAlignment);
|
||||
property WordWrap: Boolean read GetWordWrap write SetWordWrap;
|
||||
end;
|
||||
|
||||
{ TQtCheckBox }
|
||||
@ -6480,6 +6483,16 @@ end;
|
||||
|
||||
{ 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;
|
||||
var
|
||||
Parent: QWidgetH;
|
||||
|
@ -1069,8 +1069,8 @@ var
|
||||
QtStaticText: TQtStaticText;
|
||||
begin
|
||||
QtStaticText := TQtStaticText.Create(AWinControl, AParams);
|
||||
QtStaticText.WordWrap := True;
|
||||
QtStaticText.AttachEvents;
|
||||
|
||||
QtStaticText.setAlignment(AlignmentMap[TCustomStaticText(AWinControl).Alignment]);
|
||||
QtStaticText.setFrameShape(StaticBorderFrameShapeMap[TCustomStaticText(AWinControl).BorderStyle]);
|
||||
QtStaticText.setFrameShadow(StaticBorderFrameShadowMap[TCustomStaticText(AWinControl).BorderStyle]);
|
||||
|
Loading…
Reference in New Issue
Block a user