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