mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-22 16:19:36 +02:00
Qt5,Qt6: fix possible wrong result of TQtWidgetSet.GetTextExtentPoint().
(cherry picked from commit e73c702be2
)
This commit is contained in:
parent
98dc998e73
commit
aacd2f6ce5
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user