diff --git a/Orange/widgets/gui.py b/Orange/widgets/gui.py index ebae96e3acf..91ba5fb8c36 100644 --- a/Orange/widgets/gui.py +++ b/Orange/widgets/gui.py @@ -42,6 +42,7 @@ is_macstyle ) from orangewidget.utils.itemmodels import PyTableModel +from orangewidget.utils.listview import ListViewFilter try: # Some Orange widgets might expect this here @@ -192,13 +193,15 @@ def listView(widget, master, value=None, model=None, box=None, callback=None, else: bg = widget view = viewType(preferred_size=sizeHint) - if isinstance(view.model(), QSortFilterProxyModel): + if isinstance(view, ListViewFilter): view.model().setSourceModel(model) + signal = view.sigSelectionChanged else: view.setModel(model) + signal = view.selectionModel().selectionChanged if value is not None: connectControl(master, value, callback, - view.selectionModel().selectionChanged, + signal, CallFrontListView(view), CallBackListView(model, view, master, value)) misc.setdefault('uniformItemSizes', True) @@ -500,8 +503,8 @@ def __call__(self, *_): from Orange.widgets.utils.itemmodels import PyListModel selection = self.view.selectionModel().selection() - if isinstance(self.view.model(), QSortFilterProxyModel): - selection = self.view.model().mapSelectionToSource(selection) + if isinstance(self.view, ListViewFilter): + selection = self.view.selection values = [i.row() for i in selection.indexes()] # set attribute's values diff --git a/requirements-gui.txt b/requirements-gui.txt index ae9adc262e8..329da795812 100644 --- a/requirements-gui.txt +++ b/requirements-gui.txt @@ -1,5 +1,5 @@ orange-canvas-core>=0.2.2,<0.3a -orange-widget-base>=4.23.0 +orange-widget-base>=4.25.0 AnyQt>=0.2.0