Qt5,Qt6: fix possible wrong result of TQtWidgetSet.GetTextExtentPoint().

(cherry picked from commit e73c702be2)
This commit is contained in:
Željan Rikalo 2023-08-29 23:41:13 +02:00
parent 98dc998e73
commit aacd2f6ce5
2 changed files with 3 additions and 4 deletions

View File

@ -4306,7 +4306,7 @@ begin
if (Count <= 0) or (Str = nil) or (StrPas(Str) = '') then
exit;
WideStr := Str;
Size.cx := QtDC.Metrics.width(@WideStr, Count);
Size.cx := QtDC.Metrics.width(@WideStr, UTF8Length(Str, Count));
Size.cy := QtDC.Metrics.height;
Result := True;

View File

@ -3885,7 +3885,7 @@ begin
{$endif}
end;
SM_CMONITORS:
Result := QGuiApplication_screenCount; {$warning fixme Qt6} //QDesktopWidget_numScreens(QApplication_desktop());
Result := QGuiApplication_screenCount;
SM_CMOUSEBUTTONS:
begin
//DebugLn('Trace:TODO: [TQtWidgetSet.GetSystemMetrics] --> SM_CMOUSEBUTTONS ');
@ -4321,8 +4321,7 @@ begin
if (Count <= 0) or (Str = nil) or (StrPas(Str) = '') then
exit;
WideStr := {%H-}Str;
{$warning fixme Qt6}
Size.cx := QtDC.Metrics.width(@WideStr, Count);
Size.cx := QtDC.Metrics.width(@WideStr, UTF8Length(Str, Count));
Size.cy := QtDC.Metrics.height;
Result := True;