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>
|
|
|
|
|
|
|
|
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-05-14 01:14:59 +00:00
|
|
|
void setModel(QAbstractItemModel* model);
|
|
|
|
void mousePressEvent(QMouseEvent* event);
|
|
|
|
void mouseReleaseEvent(QMouseEvent* event);
|
2013-05-14 02:42:31 +00:00
|
|
|
void keyPressEvent(QKeyEvent* event);
|
|
|
|
void keyReleaseEvent(QKeyEvent*);
|
2013-05-14 01:14:59 +00:00
|
|
|
void setSelection(const QRect& rect, QItemSelectionModel::SelectionFlags command);
|
2013-05-14 11:18:26 +00:00
|
|
|
Q_SIGNALS:
|
|
|
|
void currentDiveChanged(int divenr);
|
2013-05-14 01:14:59 +00:00
|
|
|
private:
|
|
|
|
bool mouseClickSelection;
|
2013-04-12 07:24:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DIVELISTVIEW_H
|