# 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
__selectAll | Private method to select or deselect all entries.
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.
setSelection | Public method to preselect a list of entries.

### Static Methods

None

#### EricListSelectionDialog (Constructor)

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

Constructor

entries (list of str or list of tuple of (str, Any))
  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)
emptySelectionOk (bool)
  flag indicating that an empty selection is allowed
showSelectAll (bool)
  flag indicating to show a 'Select All' button
parent (QWidget)
  reference to the parent widget

#### EricListSelectionDialog.__selectAll

__selectAll(state)

Private method to select or deselect all entries.

state (bool)
  flag indicating the desired selection state

#### EricListSelectionDialog.getSelection

getSelection()

Public method to retrieve the selected items.

Return:
  selected entries

Return Type:
  list of str or list of tuple of (str, Any)

#### 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.

#### EricListSelectionDialog.setSelection

setSelection(selection)

Public method to preselect a list of entries.

selection (list of str)
  list of selected entries

Up