19 |
19 |
20 def __init__(self, selections, parent=None): |
20 def __init__(self, selections, parent=None): |
21 """ |
21 """ |
22 Constructor |
22 Constructor |
23 |
23 |
24 @param selections list of entries to select from (list of string) |
24 @param selections list of entries to select from |
25 @param parent reference to the parent widget (QWidget) |
25 @type list of str |
|
26 @param parent reference to the parent widget |
|
27 @type QWidget |
26 """ |
28 """ |
27 super().__init__(parent) |
29 super().__init__(parent) |
28 self.setupUi(self) |
30 self.setupUi(self) |
29 |
31 |
30 self.selectionList.addItems(selections) |
32 self.selectionList.addItems(selections) |
31 |
33 |
32 def getSelection(self): |
34 def getSelection(self): |
33 """ |
35 """ |
34 Public method to return the selected entries. |
36 Public method to return the selected entries. |
35 |
37 |
36 @return list of selected entries (list of string) |
38 @return list of selected entries |
|
39 @rtype list of str |
37 """ |
40 """ |
38 selection = [] |
41 selection = [] |
39 for itm in self.selectionList.selectedItems(): |
42 for itm in self.selectionList.selectedItems(): |
40 selection.append(itm.text()) |
43 selection.append(itm.text()) |
41 |
44 |