Qt: simplified selection code for TQtWSCustomListBox by using Selected[] property

git-svn-id: trunk@33174 -
This commit is contained in:
zeljko 2011-10-30 12:40:34 +00:00
parent 241bbc0b79
commit ce82b57b84

View File

@ -582,14 +582,11 @@ class procedure TQtWSCustomListBox.SelectItem(const ACustomListBox: TCustomListB
AIndex: integer; ASelected: boolean);
var
QtListWidget: TQtListWidget;
ListItem: QListWidgetItemH;
begin
if not WSCheckHandleAllocated(ACustomListBox, 'SelectItem') then
Exit;
QtListWidget := TQtListWidget(ACustomListBox.Handle);
ListItem := QtListWidget.getItem(AIndex);
if ListItem <> nil then
QtListWidget.setItemSelected(ListItem, ASelected);
QtListWidget.Selected[AIndex] := ASelected;
end;
{------------------------------------------------------------------------------