Qt5: Fixed AV when changing TListView.ViewStyle in design time. Issue #39353

This commit is contained in:
Željan Rikalo 2021-09-03 20:13:15 +02:00
parent 2473e77422
commit 63ca7a9ace

View File

@ -843,6 +843,13 @@ begin
exit(0);
QtTreeWidget := TQtTreeWidget(ALV.Handle);
{Issue #39353.Such scenario happens only when SetStyle() calls RecreateWnd
while designing control.Default width for TListColumn is 50,
unfortunatelly it''s hardcoded in listcolumn.inc.}
if (csDesigning in ALV.ComponentState) and (QtTreeWidget.ColCount <> ALV.ColumnCount) then
exit(50);
Result := QtTreeWidget.ColWidth[AIndex];
end;