|
14 | 14 | from scipy.sparse import issparse |
15 | 15 |
|
16 | 16 | from AnyQt.QtWidgets import ( |
17 | | - QTableView, QHeaderView, QAbstractButton, QAction, QApplication, |
18 | | - QStyleOptionHeader, QStyle, QStylePainter, QStyledItemDelegate |
| 17 | + QTableView, QHeaderView, QAbstractButton, QApplication, QStyleOptionHeader, |
| 18 | + QStyle, QStylePainter, QStyledItemDelegate |
19 | 19 | ) |
20 | | -from AnyQt.QtGui import QColor, QKeySequence, QClipboard |
| 20 | +from AnyQt.QtGui import QColor, QClipboard |
21 | 21 | from AnyQt.QtCore import ( |
22 | 22 | Qt, QSize, QEvent, QByteArray, QMimeData, QObject, QMetaObject, |
23 | 23 | QAbstractProxyModel, QIdentityProxyModel, QModelIndex, |
24 | | - QItemSelectionModel, QItemSelection, QItemSelectionRange, |
25 | | - QT_VERSION |
| 24 | + QItemSelectionModel, QItemSelection, QItemSelectionRange |
26 | 25 | ) |
27 | 26 | from AnyQt.QtCore import pyqtSlot as Slot |
28 | 27 |
|
|
33 | 32 | from Orange.statistics import basic_stats |
34 | 33 |
|
35 | 34 | from Orange.widgets import widget, gui |
36 | | -from Orange.widgets.settings import (Setting, ContextSetting, |
37 | | - DomainContextHandler) |
| 35 | +from Orange.widgets.settings import Setting, DomainContextHandler |
38 | 36 | from Orange.widgets.widget import Input, Output |
39 | 37 | from Orange.widgets.utils import datacaching |
40 | 38 | from Orange.widgets.utils.annotated_data import (create_annotated_table, |
@@ -390,14 +388,19 @@ class Outputs: |
390 | 388 | color_by_class = Setting(True) |
391 | 389 | settingsHandler = DomainContextHandler( |
392 | 390 | match_values=DomainContextHandler.MATCH_VALUES_ALL) |
393 | | - selected_rows = ContextSetting([]) |
394 | | - selected_cols = ContextSetting([]) |
| 391 | + selected_rows = Setting([], schema_only=True) |
| 392 | + selected_cols = Setting([], schema_only=True) |
395 | 393 |
|
396 | 394 | def __init__(self): |
397 | 395 | super().__init__() |
398 | 396 |
|
399 | 397 | self._inputs = OrderedDict() |
400 | 398 |
|
| 399 | + self.__pending_selected_rows = self.selected_rows |
| 400 | + self.selected_rows = None |
| 401 | + self.__pending_selected_cols = self.selected_cols |
| 402 | + self.selected_cols = None |
| 403 | + |
401 | 404 | self.dist_color = QColor(*self.dist_color_RGB) |
402 | 405 |
|
403 | 406 | info_box = gui.vBox(self.controlArea, "Info") |
@@ -514,9 +517,20 @@ def update(f): |
514 | 517 | self.set_info(current._input_slot.summary) |
515 | 518 |
|
516 | 519 | self.tabs.tabBar().setVisible(self.tabs.count() > 1) |
517 | | - self.selected_rows = [] |
518 | | - self.selected_cols = [] |
519 | 520 | self.openContext(data) |
| 521 | + |
| 522 | + if self.__pending_selected_rows is not None: |
| 523 | + self.selected_rows = self.__pending_selected_rows |
| 524 | + self.__pending_selected_rows = None |
| 525 | + else: |
| 526 | + self.selected_rows = [] |
| 527 | + |
| 528 | + if self.__pending_selected_cols is not None: |
| 529 | + self.selected_cols = self.__pending_selected_cols |
| 530 | + self.__pending_selected_cols = None |
| 531 | + else: |
| 532 | + self.selected_cols = [] |
| 533 | + |
520 | 534 | self.set_selection() |
521 | 535 | self.commit() |
522 | 536 |
|
|
0 commit comments