mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Dive site: show distance to current dive using extra data
Currently, in the dive-site selection widget the distance to the dive site of the current dive is shown. Instead, use the recently introduced dive_get_gps_location() function. Thus, the actual GPS coordinates extracted by libdivecomputer are used. The function is only called when the current dive changes and the location is stored in the item delegate. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
c7e1c40b0e
commit
e76298a8a7
4 changed files with 20 additions and 8 deletions
|
@ -2,6 +2,8 @@
|
|||
#ifndef MODELDELEGATES_H
|
||||
#define MODELDELEGATES_H
|
||||
|
||||
#include "core/units.h"
|
||||
|
||||
#include <QStyledItemDelegate>
|
||||
#include <QComboBox>
|
||||
class QPainter;
|
||||
|
@ -130,6 +132,9 @@ public:
|
|||
LocationFilterDelegate(QObject *parent = 0);
|
||||
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
|
||||
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
|
||||
void setCurrentLocation(location_t loc);
|
||||
private:
|
||||
location_t currentLocation;
|
||||
};
|
||||
|
||||
#endif // MODELDELEGATES_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue