From 06164b5f5f23e8b168bea1aca668ec62df81dd5d Mon Sep 17 00:00:00 2001 From: zeljko Date: Thu, 14 Jan 2016 21:11:38 +0000 Subject: [PATCH] TListFilterEdit: removed LCLQt workaround. issue #29385 Qt: unset selection when itemindex is changed. issue #29385 git-svn-id: trunk@51287 - --- components/lazcontrols/listfilteredit.pas | 5 ----- lcl/interfaces/qt/qtwsstdctrls.pp | 2 ++ 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/components/lazcontrols/listfilteredit.pas b/components/lazcontrols/listfilteredit.pas index ae2e38b6e3..5eea5e33f2 100644 --- a/components/lazcontrols/listfilteredit.pas +++ b/components/lazcontrols/listfilteredit.pas @@ -327,11 +327,6 @@ begin fFilteredListbox.Selected[i] := True; end else begin - {$IFDEF LCLQt} - // With LCL-Qt setting the ItemIndex does not clear selection. - for i := 0 to fFilteredListbox.Count - 1 do - fFilteredListbox.Selected[i] := False; - {$ENDIF LCLQt} fFilteredListbox.ItemIndex := AIndex; end; Assert(fFilteredListbox.ItemFullyVisible(AIndex), 'TListFilterEdit.MoveTo: Item not fully visible'); diff --git a/lcl/interfaces/qt/qtwsstdctrls.pp b/lcl/interfaces/qt/qtwsstdctrls.pp index 91450a8685..ecde8e529f 100644 --- a/lcl/interfaces/qt/qtwsstdctrls.pp +++ b/lcl/interfaces/qt/qtwsstdctrls.pp @@ -626,6 +626,8 @@ class procedure TQtWSCustomListBox.SetItemIndex(const ACustomListBox: TCustomLis begin if not WSCheckHandleAllocated(ACustomListBox, 'SetItemIndex') then Exit; + if TQtListWidget(ACustomListBox.Handle).currentRow <> AIndex then + TQtListWidget(ACustomListBox.Handle).clearSelection; TQtListWidget(ACustomListBox.Handle).setCurrentRow(AIndex); end;