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
|
|
@ -99,13 +99,10 @@ public:
|
|||
DiveTripModel(QObject *parent = 0);
|
||||
Layout layout() const;
|
||||
void setLayout(Layout layout);
|
||||
int columnWidth(int column);
|
||||
void setColumnWidth(int column, int width);
|
||||
|
||||
private:
|
||||
void setupModelData();
|
||||
QMap<dive_trip_t *, TripItem *> trips;
|
||||
QVector<int> columnWidthMap;
|
||||
Layout currentLayout;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue