From 46e20db82de1683a97663b61f37de3f7f3069f2f Mon Sep 17 00:00:00 2001 From: zeljan1 Date: Fri, 5 May 2023 20:15:25 +0200 Subject: [PATCH] Qt5: fixed problem with setting readOnly property under darwin. issue #40246 --- lcl/interfaces/qt5/qtwidgets.pas | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lcl/interfaces/qt5/qtwidgets.pas b/lcl/interfaces/qt5/qtwidgets.pas index 238fe0eeee..86f4f29cef 100644 --- a/lcl/interfaces/qt5/qtwidgets.pas +++ b/lcl/interfaces/qt5/qtwidgets.pas @@ -10114,7 +10114,10 @@ end; procedure TQtTextEdit.setReadOnly(const AReadOnly: Boolean); begin - QTextEdit_setReadOnly(QTextEditH(Widget), AReadOnly); + {$IFDEF DARWIN} // issue #40246 + if AReadOnly <> QTextEdit_isReadOnly(QTextEditH(Widget)) then + {$ENDIF} + QTextEdit_setReadOnly(QTextEditH(Widget), AReadOnly); end; procedure TQtTextEdit.setSelection(const AStart, ALength: Integer);