mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-07 20:53:25 +00:00
This patch adds support for switching Tree / List while clicking on a column header. This triggers a sad-painting bug on the list - I guess I'll have to fix it too. I'd apreciate some help on it, tougth. next: keep the selection. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
45 lines
1 KiB
C++
45 lines
1 KiB
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>
|
|
#include "models.h"
|
|
|
|
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(DiveTripModel::Layout layout = DiveTripModel::TREE);
|
|
|
|
public slots:
|
|
void toggleColumnVisibilityByIndex();
|
|
void reloadHeaderActions();
|
|
void headerClicked(int);
|
|
|
|
Q_SIGNALS:
|
|
void currentDiveChanged(int divenr);
|
|
private:
|
|
bool mouseClickSelection;
|
|
};
|
|
|
|
#endif // DIVELISTVIEW_H
|