Skip to content
Snippets Groups Projects
Commit 2a1f549c authored by Dimitar Tasev's avatar Dimitar Tasev
Browse files

Columns in MatrixWorkspaceDisplay are now adjustable, re #24388

parent 211af830
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,22 @@ import mantidqt.icons ...@@ -20,6 +20,22 @@ import mantidqt.icons
from mantidqt.widgets.matrixworkspacedisplay.table_view_model import MatrixWorkspaceTableViewModelType from mantidqt.widgets.matrixworkspacedisplay.table_view_model import MatrixWorkspaceTableViewModelType
class MatrixWorkspaceTableView(QTableView):
def __init__(self, parent):
super(MatrixWorkspaceTableView, self).__init__(parent)
self.setSelectionBehavior(QAbstractItemView.SelectItems)
header = self.horizontalHeader()
header.sectionDoubleClicked.connect(self.handle_double_click)
def resizeEvent(self, event):
header = self.horizontalHeader()
header.setSectionResizeMode(QHeaderView.Interactive)
def handle_double_click(self, section):
header = self.horizontalHeader()
header.resizeSection(section, header.defaultSectionSize())
class MatrixWorkspaceDisplayView(QTabWidget): class MatrixWorkspaceDisplayView(QTabWidget):
def __init__(self, presenter, parent=None, name=''): def __init__(self, presenter, parent=None, name=''):
super(MatrixWorkspaceDisplayView, self).__init__(parent) super(MatrixWorkspaceDisplayView, self).__init__(parent)
...@@ -51,8 +67,8 @@ class MatrixWorkspaceDisplayView(QTabWidget): ...@@ -51,8 +67,8 @@ class MatrixWorkspaceDisplayView(QTabWidget):
self.show() self.show()
def add_table(self, label): def add_table(self, label):
tab = QTableView() tab = MatrixWorkspaceTableView(self)
tab.setSelectionBehavior(QAbstractItemView.SelectItems)
self.addTab(tab, label) self.addTab(tab, label)
self.tabs.append(tab) self.tabs.append(tab)
return tab return tab
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment