mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-10-01 03:29:25 +02:00
Qt,Qt5: allow usage of html formatted text in dialogs via define.
git-svn-id: trunk@64982 -
This commit is contained in:
parent
d84f74bc79
commit
0023eaced0
@ -15,4 +15,5 @@
|
||||
{enable this define if you have problems when dialogs are shown behind application}
|
||||
{.$DEFINE TQTMESSAGEBOXUSEPARENT}
|
||||
{$ENDIF}
|
||||
{.$DEFINE QTDIALOGSUSEHTMLTEXT} {we use plain text for dialogs - if enabled then dialogs can contain html formatted text}
|
||||
{$ENDIF}
|
||||
|
@ -19617,7 +19617,9 @@ begin
|
||||
AParent := QApplication_activeWindow;
|
||||
{$ENDIF}
|
||||
Widget := CreateWidget(AParent);
|
||||
{$IFDEF QTDIALOGSUSEHTMLTEXT}
|
||||
TextFormat := QtPlainText;
|
||||
{$ENDIF}
|
||||
setProperty(Widget, 'lclwidget', Int64(PtrUInt(Self)));
|
||||
QtWidgetSet.AddHandle(Self);
|
||||
end;
|
||||
|
@ -21,4 +21,5 @@
|
||||
{enable this define if you have Qt build with "QT_NO_SESSIONMANAGER" for example Somlabs i.MX8 with Wayland }
|
||||
{defined on Qt side in file "qtgui-config.h"}
|
||||
{.$DEFINE QT_NO_SESSIONMANAGER}
|
||||
{.$DEFINE QTDIALOGSUSEHTMLTEXT} {we use plain text for dialogs - if enabled then dialogs can contain html formatted text}
|
||||
{$ENDIF}
|
||||
|
@ -19767,7 +19767,9 @@ begin
|
||||
AParent := QApplication_activeWindow;
|
||||
{$ENDIF}
|
||||
Widget := CreateWidget(AParent);
|
||||
{$IFNDEF QTDIALOGSUSEHTMLTEXT}
|
||||
TextFormat := QtPlainText;
|
||||
{$ENDIF}
|
||||
setProperty(Widget, 'lclwidget', Int64(PtrUInt(Self)));
|
||||
QtWidgetSet.AddHandle(Self);
|
||||
end;
|
||||
|
@ -5202,7 +5202,9 @@ var
|
||||
//OkStr: WideString;
|
||||
AParent: QWidgetH;
|
||||
DialogType, DefButton, DefIcon : Cardinal;
|
||||
{$IFNDEF QTDIALOGSUSEHTMLTEXT}
|
||||
AQtString: QStringH;
|
||||
{$ENDIF}
|
||||
begin
|
||||
Result := 0;
|
||||
Str := GetUtf8String(lpText);
|
||||
@ -5216,10 +5218,12 @@ begin
|
||||
DialogType:= (uType and $0000000F);
|
||||
DefIcon := (uType and $000000FF) shr 4;
|
||||
|
||||
{$IFNDEF QTDIALOGSUSEHTMLTEXT}
|
||||
//issue #37805 - we must show plain text.
|
||||
AQtString := QString_Create(PWideString(@Str));
|
||||
QString_toHtmlEscaped(AQtString, @Str);
|
||||
QString_destroy(AQtString);
|
||||
{$ENDIF}
|
||||
|
||||
case IconToMessageType(DefIcon) of
|
||||
QMessageBoxInformation: Result := QMessageBox_information(AParent, @TitleStr, @Str, ButtonToQtButtons(DialogType), ButtonToQtDefButton(DialogType, DefButton));
|
||||
|
Loading…
Reference in New Issue
Block a user