mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-07 05:18:17 +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);
|
AIndex: integer; ASelected: boolean);
|
||||||
var
|
var
|
||||||
QtListWidget: TQtListWidget;
|
QtListWidget: TQtListWidget;
|
||||||
ListItem: QListWidgetItemH;
|
|
||||||
begin
|
begin
|
||||||
if not WSCheckHandleAllocated(ACustomListBox, 'SelectItem') then
|
if not WSCheckHandleAllocated(ACustomListBox, 'SelectItem') then
|
||||||
Exit;
|
Exit;
|
||||||
QtListWidget := TQtListWidget(ACustomListBox.Handle);
|
QtListWidget := TQtListWidget(ACustomListBox.Handle);
|
||||||
ListItem := QtListWidget.getItem(AIndex);
|
QtListWidget.Selected[AIndex] := ASelected;
|
||||||
if ListItem <> nil then
|
|
||||||
QtListWidget.setItemSelected(ListItem, ASelected);
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user