mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Dive list view: move column width logic back from DiveTripModel
Conceptually, the width of the columns should probably reside in the view not the model. But much more severly, the old code didn't work: Columns were set in a DiveTripModel, which was deleted right away. Therefore, move the logic back to the DiveListView. Introduce a QVector<int> of the initial column widths, so that they can be erased from the setting if unchanged. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
d3dc698bba
commit
079b99135a
4 changed files with 53 additions and 92 deletions
|
@ -71,12 +71,14 @@ private:
|
|||
QModelIndex contextMenuIndex;
|
||||
bool dontEmitDiveChangedSignal;
|
||||
bool selectionSaved;
|
||||
DiveTripModel *tripModel;
|
||||
// Remember the initial column widths, to avoid writing unchanged widths to the settings
|
||||
QVector<int> initialColumnWidths;
|
||||
|
||||
/* if dive_trip_t is null, there's no problem. */
|
||||
QMultiHash<dive_trip_t *, int> selectedDives;
|
||||
void merge_trip(const QModelIndex &a, const int offset);
|
||||
void setupUi();
|
||||
void calculateInitialColumnWidth(const DiveTripModel &tripModel, int col);
|
||||
void backupExpandedRows();
|
||||
void restoreExpandedRows();
|
||||
int lastVisibleColumn();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue