subsurface/desktop-widgets/divesitelistview.h
Berthold Stoeger 6b835710bc map: use value semantics for MapLocation
This makes memory management more simple, as not explicit deletion
is necessary.

A rather large commit, because changing QVector<> to std::vector<>
is propagated up the call chain.

Adds a new range_contains() helper function for collection
types such as std::vector<>. I didn't want to call it
contains(), since we already have a contains function
for strings and let's keep argument overloading simple.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-08-13 19:28:30 +02:00

30 lines
829 B
C++

// SPDX-License-Identifier: GPL-2.0
#ifndef DIVE_SITE_LIST_VIEW_H
#define DIVE_SITE_LIST_VIEW_H
#include "ui_divesitelistview.h"
class DiveSiteSortedModel;
class DiveSiteListView : public QWidget {
Q_OBJECT
public:
DiveSiteListView(QWidget *parent = 0);
private slots:
void add();
void done();
void diveSiteAdded(struct dive_site *, int idx);
void diveSiteChanged(struct dive_site *ds, int field);
void diveSiteClicked(const QModelIndex &);
void on_purgeUnused_clicked();
void on_filterText_textChanged(const QString &text);
void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
private:
Ui::DiveSiteListView ui;
DiveSiteSortedModel *model;
std::vector<dive_site *> selectedDiveSites();
void hideEvent(QHideEvent *) override;
void showEvent(QShowEvent *) override;
};
#endif