2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-26 03:38:25 +08:00

gui: auto resize of table columns

This commit is contained in:
Sebastien Bourdeauducq 2015-07-23 22:36:52 +08:00
parent 0b10f72c2b
commit aa2acb9137
4 changed files with 8 additions and 0 deletions

View File

@ -23,6 +23,8 @@ class LogDock(dockarea.Dock):
self.log = QtGui.QTableView() self.log = QtGui.QTableView()
self.log.setSelectionMode(QtGui.QAbstractItemView.NoSelection) self.log.setSelectionMode(QtGui.QAbstractItemView.NoSelection)
self.log.horizontalHeader().setResizeMode(
QtGui.QHeaderView.ResizeToContents)
self.addWidget(self.log) self.addWidget(self.log)
@asyncio.coroutine @asyncio.coroutine

View File

@ -39,6 +39,8 @@ class ParametersDock(dockarea.Dock):
self.table = QtGui.QTableView() self.table = QtGui.QTableView()
self.table.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) self.table.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
self.table.horizontalHeader().setResizeMode(
QtGui.QHeaderView.ResizeToContents)
grid.addWidget(self.table, 1, 0) grid.addWidget(self.table, 1, 0)
def search_parameters(self): def search_parameters(self):

View File

@ -39,6 +39,8 @@ class ResultsDock(dockarea.Dock):
self.table = QtGui.QTableView() self.table = QtGui.QTableView()
self.table.setSelectionMode(QtGui.QAbstractItemView.NoSelection) self.table.setSelectionMode(QtGui.QAbstractItemView.NoSelection)
self.table.horizontalHeader().setResizeMode(
QtGui.QHeaderView.ResizeToContents)
grid.addWidget(self.table, 0, 0) grid.addWidget(self.table, 0, 0)
add_display_box = QtGui.QGroupBox("Add display") add_display_box = QtGui.QGroupBox("Add display")

View File

@ -54,6 +54,8 @@ class ScheduleDock(dockarea.Dock):
self.table = QtGui.QTableView() self.table = QtGui.QTableView()
self.table.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) self.table.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
self.table.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) self.table.setSelectionMode(QtGui.QAbstractItemView.SingleSelection)
self.table.horizontalHeader().setResizeMode(
QtGui.QHeaderView.ResizeToContents)
self.addWidget(self.table) self.addWidget(self.table)
self.table.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu) self.table.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)