subsurface/qt-ui/divelistview.h
Dirk Hohndel 43892e36fd Fix colum visibility selection in the divelist
Several changes:
- split the reload of the DiveListView from the reload of the header
- don't include the column title in the name of the setting; the title
  will change depending on the units and localization chosen by the user
- rename the slot that toggles visibility to make the code more readable
- use setCollumHidden() method to simplify the code
- don't save the width of hidden columns (as they would be saved as zero
  width and can then no longer be enabled)

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2013-05-26 10:16:01 -07:00

43 lines
970 B
C++

/*
* divelistview.h
*
* header file for the dive list of Subsurface
*
*/
#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
{
Q_OBJECT
public:
DiveListView(QWidget *parent = 0);
void selectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
void currentChanged(const QModelIndex& current, const QModelIndex& previous);
void mousePressEvent(QMouseEvent* event);
void mouseReleaseEvent(QMouseEvent* event);
void keyPressEvent(QKeyEvent* event);
void keyReleaseEvent(QKeyEvent*);
void setSelection(const QRect& rect, QItemSelectionModel::SelectionFlags command);
void reload();
public slots:
void toggleColumnVisibilityByIndex();
void reloadHeaderActions();
Q_SIGNALS:
void currentDiveChanged(int divenr);
private:
bool mouseClickSelection;
};
#endif // DIVELISTVIEW_H