From c1d775df54bd7ed1e9dc8a78a04032992e4a1eec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDeljan=20Rikalo?= Date: Mon, 26 Jun 2023 23:28:38 +0200 Subject: [PATCH] Qt5,Qt6: fixed crash of TListView in design time. issue #40349 --- lcl/interfaces/qt5/qtwscomctrls.pp | 3 ++- lcl/interfaces/qt6/qtwscomctrls.pp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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)