Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

owtable: Do not reset header view state on new data #6678

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Orange/widgets/data/owtable.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,6 @@ def sizeHint(self):
@Inputs.data
def set_dataset(self, data: Optional[Table]):
"""Set the input dataset."""
# reset the (header) view state.
self.view.setModel(None)
self.view.horizontalHeader().setSortIndicator(-1, Qt.AscendingOrder)
if data is not None:
summary = tsummary.table_summary(data)
self.input = InputData(
Expand Down Expand Up @@ -353,7 +350,6 @@ def _setup_table_view(self):
view = self.view
data = self.input.table
rowcount = data.approx_len()

view.setModel(datamodel)

vheader = view.verticalHeader()
Expand Down
1 change: 1 addition & 0 deletions Orange/widgets/data/utils/tableview.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def setModel(self, model: QAbstractItemModel):
select_rows = self.selectionBehavior() == TableView.SelectRows
sel_model = BlockSelectionModel(model, selectBlocks=not select_rows)
self.setSelectionModel(sel_model)
self.horizontalHeader().setSortIndicator(-1, Qt.AscendingOrder)

sortable = self.isModelSortable(model)
self.setSortingEnabled(sortable)
Expand Down
Loading