mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-16 02:00:30 +01:00
Qt: do not accept rich text in any case in TCustomMemo (eg. paste html mime data).
git-svn-id: trunk@36171 -
This commit is contained in:
parent
9bd7d03126
commit
86a85a3be4
@ -793,6 +793,8 @@ type
|
||||
FUndoAvailableHook: QTextEdit_hookH;
|
||||
FTextChangedHook: QTextEdit_hookH;
|
||||
FUndoAvailable: Boolean;
|
||||
function GetAcceptRichText: Boolean;
|
||||
procedure SetAcceptRichText(AValue: Boolean);
|
||||
protected
|
||||
function CreateWidget(const AParams: TCreateParams):QWidgetH; override;
|
||||
public
|
||||
@ -835,6 +837,7 @@ type
|
||||
procedure setContextMenuPolicy(const AValue: QtContextMenuPolicy); override;
|
||||
procedure SignalUndoAvailable(b: Boolean); cdecl;
|
||||
procedure SignalTextChanged(); cdecl;
|
||||
property AcceptRichText: Boolean read GetAcceptRichText write SetAcceptRichText;
|
||||
end;
|
||||
|
||||
{ TQtTabBar }
|
||||
@ -7883,6 +7886,16 @@ end;
|
||||
|
||||
{ TQtTextEdit }
|
||||
|
||||
function TQtTextEdit.GetAcceptRichText: Boolean;
|
||||
begin
|
||||
Result := QTextEdit_acceptRichText(QTextEditH(Widget));
|
||||
end;
|
||||
|
||||
procedure TQtTextEdit.SetAcceptRichText(AValue: Boolean);
|
||||
begin
|
||||
QTextEdit_setAcceptRichText(QTextEditH(Widget), AValue);
|
||||
end;
|
||||
|
||||
function TQtTextEdit.CreateWidget(const AParams: TCreateParams): QWidgetH;
|
||||
var
|
||||
Parent: QWidgetH;
|
||||
|
||||
@ -718,6 +718,7 @@ var
|
||||
QtTextEdit: TQtTextEdit;
|
||||
begin
|
||||
QtTextEdit := TQtTextEdit.Create(AWinControl, AParams);
|
||||
QtTextEdit.AcceptRichText := False;
|
||||
QtTextEdit.ClearText;
|
||||
QtTextEdit.setBorder(TCustomMemo(AWinControl).BorderStyle = bsSingle);
|
||||
QtTextEdit.setReadOnly(TCustomMemo(AWinControl).ReadOnly);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user