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

(cherry picked from commit 63ca7a9ace)
This commit is contained in:
Željan Rikalo 2021-09-03 20:13:15 +02:00 committed by Maxim Ganetsky
parent 75f7903c0d
commit d767c1dcee

View File

@ -841,6 +841,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;