-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cc1d261
commit ad60a2c
Showing
3 changed files
with
34 additions
and
17 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
qt/python/mantidqt/mantidqt/widgets/workspacedisplay/table/group_view.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Mantid Repository : https://github.com/mantidproject/mantid | ||
# | ||
# Copyright © 2024 ISIS Rutherford Appleton Laboratory UKRI, | ||
# NScD Oak Ridge National Laboratory, European Spallation Source, | ||
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS | ||
# SPDX - License - Identifier: GPL - 3.0 + | ||
# This file is part of the mantidqt package. | ||
|
||
from qtpy.QtCore import Qt, QSortFilterProxyModel | ||
from mantidqt.widgets.workspacedisplay.table.view import TableWorkspaceDisplayView | ||
|
||
|
||
class GroupTableWorkspaceDisplayView(TableWorkspaceDisplayView): | ||
"""Specialization of a table view to display peaks | ||
Designed specifically to be used by PeaksViewerView | ||
""" | ||
|
||
def __init__(self, *args, **kwargs): | ||
TableWorkspaceDisplayView.__init__(self, *args, **kwargs) | ||
self.source_model = TableWorkspaceDisplayView.model(self) | ||
self.proxy_model = QSortFilterProxyModel() | ||
self.proxy_model.setSourceModel(self.table_model) | ||
self.setModel(self.proxy_model) | ||
|
||
def model(self): | ||
return self.source_model | ||
|
||
def sortBySelectedColumn(self, selected_column, sort_ascending): | ||
self.sortByColumn(selected_column, Qt.AscendingOrder if sort_ascending else Qt.DescendingOrder) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters