From aa2acb9137ab192b1ce10ce897987d727158a912 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 23 Jul 2015 22:36:52 +0800 Subject: [PATCH] gui: auto resize of table columns --- artiq/gui/log.py | 2 ++ artiq/gui/parameters.py | 2 ++ artiq/gui/results.py | 2 ++ artiq/gui/schedule.py | 2 ++ 4 files changed, 8 insertions(+) diff --git a/artiq/gui/log.py b/artiq/gui/log.py index 77981a37f..0c6c7cb22 100644 --- a/artiq/gui/log.py +++ b/artiq/gui/log.py @@ -23,6 +23,8 @@ class LogDock(dockarea.Dock): self.log = QtGui.QTableView() self.log.setSelectionMode(QtGui.QAbstractItemView.NoSelection) + self.log.horizontalHeader().setResizeMode( + QtGui.QHeaderView.ResizeToContents) self.addWidget(self.log) @asyncio.coroutine diff --git a/artiq/gui/parameters.py b/artiq/gui/parameters.py index e608beae2..5fbac5866 100644 --- a/artiq/gui/parameters.py +++ b/artiq/gui/parameters.py @@ -39,6 +39,8 @@ class ParametersDock(dockarea.Dock): self.table = QtGui.QTableView() self.table.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) + self.table.horizontalHeader().setResizeMode( + QtGui.QHeaderView.ResizeToContents) grid.addWidget(self.table, 1, 0) def search_parameters(self): diff --git a/artiq/gui/results.py b/artiq/gui/results.py index 900e16663..964856744 100644 --- a/artiq/gui/results.py +++ b/artiq/gui/results.py @@ -39,6 +39,8 @@ class ResultsDock(dockarea.Dock): self.table = QtGui.QTableView() self.table.setSelectionMode(QtGui.QAbstractItemView.NoSelection) + self.table.horizontalHeader().setResizeMode( + QtGui.QHeaderView.ResizeToContents) grid.addWidget(self.table, 0, 0) add_display_box = QtGui.QGroupBox("Add display") diff --git a/artiq/gui/schedule.py b/artiq/gui/schedule.py index 363cc6570..d023c880b 100644 --- a/artiq/gui/schedule.py +++ b/artiq/gui/schedule.py @@ -54,6 +54,8 @@ class ScheduleDock(dockarea.Dock): self.table = QtGui.QTableView() self.table.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows) self.table.setSelectionMode(QtGui.QAbstractItemView.SingleSelection) + self.table.horizontalHeader().setResizeMode( + QtGui.QHeaderView.ResizeToContents) self.addWidget(self.table) self.table.setContextMenuPolicy(QtCore.Qt.ActionsContextMenu)