# eric7.EricWidgets.EricListSelectionDialog

Module implementing a dialog to select from a list of strings.

### Global Attributes

None

### Classes

EricListSelectionDialog | Class implementing a dialog to select from a list of strings.

### Functions

None

## EricListSelectionDialog

Class implementing a dialog to select from a list of strings.

### Derived from

QDialog, Ui_EricListSelectionDialog

### Class Attributes

None

### Class Methods

None

### Methods

EricListSelectionDialog | Constructor
getSelection | Public method to retrieve the selected items.
on_selectionList_itemChanged | Private slot handling a change of an item.
on_selectionList_itemDoubleClicked | Private slot handling double clicking an item.
on_selectionList_itemSelectionChanged | Private slot handling a change of the selection.

### Static Methods

None

#### EricListSelectionDialog (Constructor)

EricListSelectionDialog(entries, selectionMode=QAbstractItemView.SelectionMode.ExtendedSelection, title="", message="", checkBoxSelection=False, doubleClickOk=False, parent=None, )

Constructor

entries (list of str)
  list of entries to select from
selectionMode (QAbstractItemView.SelectionMode)
  selection mode for the list
title (str)
  title of the dialog
message (str)
  message to be show in the dialog
checkBoxSelection (bool)
  flag indicating to select items via their checkbox
doubleClickOk (bool)
  flag indicating to accept the dialog upon a double click of an item (single selection only)
parent (QWidget)
  reference to the parent widget

#### EricListSelectionDialog.getSelection

getSelection()

Public method to retrieve the selected items.

Return:
  selected entries

Return Type:
  list of str

#### EricListSelectionDialog.on_selectionList_itemChanged

on_selectionList_itemChanged(itm)

Private slot handling a change of an item.

itm (QListWidgetItem)
  reference to the changed item

#### EricListSelectionDialog.on_selectionList_itemDoubleClicked

on_selectionList_itemDoubleClicked(item)

Private slot handling double clicking an item.

item (QListWidgetItem)
  double clicked item

#### EricListSelectionDialog.on_selectionList_itemSelectionChanged

on_selectionList_itemSelectionChanged()

Private slot handling a change of the selection.

Up