Dive sites: stretch name and description columns

Stretch the name and description columns in the dive site table,
so that they don't start too small. This should only be a temporary
solution, as it disables the save column width to preferences
feature of TableView.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-03-16 12:09:58 +01:00 committed by Dirk Hohndel
parent d0435672ac
commit fde80eeaa5

View file

@ -15,6 +15,8 @@ TabDiveSite::TabDiveSite(QWidget *parent) : TabBase(parent)
// Default: sort by name // Default: sort by name
ui.diveSites->view()->sortByColumn(LocationInformationModel::NAME, Qt::AscendingOrder); ui.diveSites->view()->sortByColumn(LocationInformationModel::NAME, Qt::AscendingOrder);
ui.diveSites->view()->setSortingEnabled(true); ui.diveSites->view()->setSortingEnabled(true);
ui.diveSites->view()->horizontalHeader()->setSectionResizeMode(LocationInformationModel::NAME, QHeaderView::Stretch);
ui.diveSites->view()->horizontalHeader()->setSectionResizeMode(LocationInformationModel::DESCRIPTION, QHeaderView::Stretch);
// Show only the first few columns // Show only the first few columns
for (int i = LocationInformationModel::LOCATION; i < LocationInformationModel::COLUMNS; ++i) for (int i = LocationInformationModel::LOCATION; i < LocationInformationModel::COLUMNS; ++i)