diff --git a/lcl/interfaces/qt5/qtwscomctrls.pp b/lcl/interfaces/qt5/qtwscomctrls.pp index 0bec6bb840..cb8abe9aa2 100644 --- a/lcl/interfaces/qt5/qtwscomctrls.pp +++ b/lcl/interfaces/qt5/qtwscomctrls.pp @@ -894,7 +894,8 @@ begin exit; QtTreeWidget := TQtTreeWidget(ALV.Handle); - if Assigned(QtTreeWidget) then + if Assigned(QtTreeWidget) and + not (csDesigning in ALV.ComponentState) then begin if ASortIndicator = siNone then QtTreeWidget.Header.SetSortIndicatorVisible(false) diff --git a/lcl/interfaces/qt6/qtwscomctrls.pp b/lcl/interfaces/qt6/qtwscomctrls.pp index 931c4bc8bd..07fbe86785 100644 --- a/lcl/interfaces/qt6/qtwscomctrls.pp +++ b/lcl/interfaces/qt6/qtwscomctrls.pp @@ -892,7 +892,8 @@ begin exit; QtTreeWidget := TQtTreeWidget(ALV.Handle); - if Assigned(QtTreeWidget) then + if Assigned(QtTreeWidget) and + not (csDesigning in ALV.ComponentState) then begin if ASortIndicator = siNone then QtTreeWidget.Header.SetSortIndicatorVisible(false)