Qt5: fixed blurred text when drawing QImage and QPixmap and hidpi enabled for qt libs >= 5.14. issue #41276

This commit is contained in:
Željan Rikalo 2024-12-12 16:41:56 +01:00
parent 5cb22fbc12
commit 4c1940a28c

View File

@ -25,6 +25,11 @@ begin
FLastWFPMousePos := Point(MaxInt, MaxInt);
FLastWFPResult := 0;
inherited Create;
{$J+}
QtVersionInt(QtVersionMajor, QtVersionMinor, QtVersionMicro);
{$J-}
FIsLibraryInstance := QCoreApplication_instance() <> nil;
if FIsLibraryInstance then
App := QApplicationH(QCoreApplication_instance())
@ -35,8 +40,13 @@ begin
WStr := 'plugins';
QCoreApplication_addLibraryPath(@WStr);
{$ENDIF}
// issue #39610
// QCoreApplication_setAttribute(QtAA_DisableHighDpiScaling, True);
{$IF DEFINED(UNIX) AND NOT DEFINED(DARWIN)}
if (QtVersionMajor = 5) and (QtVersionMinor >= 14) then
begin
QCoreApplication_setAttribute(QtAA_EnableHighDpiScaling, False); // issue #39610, #41276
QCoreApplication_setAttribute(QtAA_DisableHighDpiScaling, True); // issue #39610, #41276
end;
{$ENDIF}
App := QApplication_Create(@argc, argv);
end;
QCoreApplication_setAttribute(QtAA_DontCreateNativeWidgetSiblings, True);
@ -46,9 +56,6 @@ begin
{$IFDEF QtUseNativeEventLoop}
FMainTimerID := -1;
{$ENDIF}
{$J+}
QtVersionInt(QtVersionMajor, QtVersionMinor, QtVersionMicro);
{$J-}
FCachedMenuBarHeight := -1;
FAppEvenFilterHook := nil;
{$IFDEF QTUSEFOCUSCHANGEDHOOK}