Dive list: access header via filter-model

The dive list accesses the filter model, therefore it makes sense
to also get the header data from there, even if they are only
forwarded from the source model.

This makes control flow more logical and will allow us to remove
the global DiveTripModel instance.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2019-12-09 15:25:16 +01:00 committed by Dirk Hohndel
parent e7dafe36aa
commit 0f417a3bc1

View file

@ -93,7 +93,7 @@ void DiveListView::calculateInitialColumnWidth(int col)
int em = metrics.width('m');
int zw = metrics.width('0');
QString header_txt = DiveTripModelBase::instance()->headerData(col, Qt::Horizontal, Qt::DisplayRole).toString();
QString header_txt = MultiFilterSortModel::instance()->headerData(col, Qt::Horizontal, Qt::DisplayRole).toString();
int width = metrics.width(header_txt);
int sw = 0;
switch (col) {