mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-06 18:18:18 +02:00
Qt: simplified selection code for TQtWSCustomListBox by using Selected[] property
git-svn-id: trunk@33174 -
This commit is contained in:
parent
241bbc0b79
commit
ce82b57b84
@ -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;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user