From 81e27b6db9aba39dd80d7c9ec5ae6e01d5966075 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 25 May 2013 20:04:31 -0700 Subject: Try to make the equipment tab more compact My attempts to actually set the width of the columns with the SizeHintRole all failed - so I gave up on that and am forcing things to work by making the texts in the header somewhat longer and then resizing to that. Definitely not what I wanted to do - but that plus reducing the font size gives us a much more reasonable / compact look. I really hope that someone else can explain to me how to get the SizeHintRole to affect the width (and not just the height - that part worked just fine) of a the cells in a column. Then we can replace this hack by a much better solution (that won't fail if the translated strings look different). Signed-off-by: Dirk Hohndel --- qt-ui/maintab.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'qt-ui/maintab.cpp') diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 4710c048a..ca2f18ef0 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -80,7 +80,8 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent), connect(ui->weights, SIGNAL(clicked(QModelIndex)), ui->weights->model(), SLOT(remove(QModelIndex))); ui->cylinders->setColumnWidth(CylindersModel::REMOVE, 24); - ui->cylinders->horizontalHeader()->setResizeMode (CylindersModel::REMOVE , QHeaderView::Fixed); + ui->cylinders->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents); + ui->cylinders->horizontalHeader()->setResizeMode(CylindersModel::REMOVE, QHeaderView::Fixed); ui->cylinders->setItemDelegateForColumn(CylindersModel::TYPE, new TankInfoDelegate()); ui->weights->setColumnWidth(WeightModel::REMOVE, 24); ui->weights->horizontalHeader()->setResizeMode (WeightModel::REMOVE , QHeaderView::Fixed); -- cgit v1.2.3-70-g09d2