2013-04-14 03:44:02 +00:00
|
|
|
/*
|
|
|
|
* divelistview.h
|
|
|
|
*
|
|
|
|
* header file for the dive list of Subsurface
|
|
|
|
*
|
|
|
|
*/
|
2013-04-12 07:24:07 +00:00
|
|
|
#ifndef DIVELISTVIEW_H
|
|
|
|
#define DIVELISTVIEW_H
|
|
|
|
|
|
|
|
/*! A view subclass for use with dives
|
|
|
|
|
|
|
|
Note: calling this a list view might be misleading?
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <QTreeView>
|
2013-05-28 20:07:43 +00:00
|
|
|
#include "models.h"
|
2013-04-12 07:24:07 +00:00
|
|
|
|
|
|
|
class DiveListView : public QTreeView
|
|
|
|
{
|
2013-05-14 11:18:26 +00:00
|
|
|
Q_OBJECT
|
2013-04-12 07:24:07 +00:00
|
|
|
public:
|
|
|
|
DiveListView(QWidget *parent = 0);
|
2013-05-14 01:14:59 +00:00
|
|
|
void selectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
|
2013-05-14 11:18:26 +00:00
|
|
|
void currentChanged(const QModelIndex& current, const QModelIndex& previous);
|
2013-06-06 02:22:08 +00:00
|
|
|
void reload(DiveTripModel::Layout layout, bool forceSort = true);
|
2013-05-30 04:04:42 +00:00
|
|
|
bool eventFilter(QObject* , QEvent* );
|
2013-06-05 06:41:52 +00:00
|
|
|
void unselectDives();
|
2013-06-08 01:25:30 +00:00
|
|
|
void selectDive(struct dive *, bool scrollto = false, bool toggle = false);
|
2013-06-06 00:06:42 +00:00
|
|
|
void contextMenuEvent(QContextMenuEvent *event);
|
2013-06-14 16:17:46 +00:00
|
|
|
QSet<dive_trip_t *> selectedTrips;
|
2013-05-16 19:00:33 +00:00
|
|
|
|
2013-05-21 19:51:49 +00:00
|
|
|
public slots:
|
2013-05-26 17:12:45 +00:00
|
|
|
void toggleColumnVisibilityByIndex();
|
|
|
|
void reloadHeaderActions();
|
2013-05-28 20:07:43 +00:00
|
|
|
void headerClicked(int);
|
2013-05-30 04:04:42 +00:00
|
|
|
void showSearchEdit();
|
2013-06-06 00:06:42 +00:00
|
|
|
void removeFromTrip();
|
2013-06-06 01:37:18 +00:00
|
|
|
void deleteDive();
|
2013-06-06 00:06:42 +00:00
|
|
|
void testSlot();
|
2013-06-12 17:14:25 +00:00
|
|
|
void fixMessyQtModelBehaviour();
|
2013-06-27 05:16:40 +00:00
|
|
|
void mergeTripAbove();
|
|
|
|
void mergeTripBelow();
|
2013-06-14 16:17:46 +00:00
|
|
|
|
2013-06-19 17:20:16 +00:00
|
|
|
signals:
|
2013-05-14 11:18:26 +00:00
|
|
|
void currentDiveChanged(int divenr);
|
2013-06-06 00:06:42 +00:00
|
|
|
|
2013-05-14 01:14:59 +00:00
|
|
|
private:
|
|
|
|
bool mouseClickSelection;
|
2013-05-29 19:46:27 +00:00
|
|
|
int currentHeaderClicked;
|
|
|
|
DiveTripModel::Layout currentLayout;
|
2013-05-30 04:04:42 +00:00
|
|
|
QLineEdit *searchBox;
|
2013-06-06 00:06:42 +00:00
|
|
|
QModelIndex contextMenuIndex;
|
2013-06-27 05:16:40 +00:00
|
|
|
void merge_trip(const QModelIndex &a, const int offset);
|
2013-04-12 07:24:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DIVELISTVIEW_H
|