Isis Developer Reference
TableViewHeader.h
Go to the documentation of this file.
1#ifndef TableViewHeader_H
2#define TableViewHeader_H
3
10/* SPDX-License-Identifier: CC0-1.0 */
11
12#include <QWidget>
13
14class QMouseEvent;
15class QPainter;
16class QPaintEvent;
17class QSize;
18class QStringList;
19template<typename T> class QList;
20
21
22namespace Isis {
23 class AbstractTableModel;
24 class TableColumnList;
25
34 class TableViewHeader : public QWidget {
35
36 Q_OBJECT
37
38 public:
39 explicit TableViewHeader(AbstractTableModel *someModel);
40 virtual ~TableViewHeader();
41 virtual void setColumns(TableColumnList *);
42 QSize minimumSizeHint() const;
43 QSize sizeHint() const;
44
45 void setModel(AbstractTableModel *someModel);
46
47
48 signals:
49 void columnResized(bool lastColumn);
50 void requestedGlobalSelection(bool select);
51 void requestedColumnSelection(int columnNum, bool select);
52 void sortingEnabled(bool);
53
54
55 public slots:
56 void handleFilterCountsChanged(int visibleTopLevelItemCount,
57 int topLevelItemCount);
58 void updateHeaderOffset(int);
59 void updateFilterProgress(int newProgress);
60 void updateFilterProgressRange(int min, int max);
61 void updateRebuildProgress(int newProgress);
62 void updateRebuildProgressRange(int min, int max);
63 void updateSortProgress(int newProgress);
64 void updateSortProgressRange(int min, int max);
65
66
67 protected:
68 void mouseMoveEvent(QMouseEvent *event);
69 void mousePressEvent(QMouseEvent *event);
70 void mouseReleaseEvent(QMouseEvent *event);
71 void paintEvent(QPaintEvent *event);
72
73
74 private: // methods
75 TableViewHeader(const TableViewHeader &other);
76 TableViewHeader &operator=(TableViewHeader other);
77 void nullify();
78 QRect getColumnRect(int column) const;
79 int getMousedColumn(QPoint mousePos);
80 int getMousedColumnEdge(QPoint mousePos);
81 bool mouseAtResizableColumnEdge(QPoint mousePos);
82 void paintHeader(QPainter *painter, int rowheight);
83 void paintProgress(QPainter *painter, const QRect &rect, int min,
84 int max, int value, bool over100);
85 QRect getSortingPriorityRect(int visColIndex);
86 QRect getSortingArrowRect(int visColIndex);
87
88
89 private: // data
90 TableColumnList *m_columns;
91 int m_horizontalOffset;
92 int m_filterProgress;
93 int m_filterProgressMin;
94 int m_filterProgressMax;
95 int m_rebuildProgress;
96 int m_rebuildProgressMin;
97 int m_rebuildProgressMax;
98 int m_sortProgress;
99 int m_sortProgressMin;
100 int m_sortProgressMax;
101
102 int m_visibleCount;
103 int m_totalCount;
104
105 int m_clickedColumnEdge;
106 int m_clickedColumn;
107
108 static int const SORT_ARROW_MARGIN = 10;
109 int ARROW_HEIGHT;
110 int ARROW_WIDTH;
111
112 AbstractTableModel *m_model;
113 };
114}
115
116
117#endif
Translates the tree model into a table model.
Definition AbstractTableModel.h:48
Definition TableColumnList.h:30
Definition TableViewHeader.h:34
void updateFilterProgressRange(int min, int max)
Updates the range of the filter progress.
Definition TableViewHeader.cpp:632
void mouseMoveEvent(QMouseEvent *event)
Overrides QWidget::mouseMoveEvent.
Definition TableViewHeader.cpp:247
void mouseReleaseEvent(QMouseEvent *event)
Overrides QWidget::mouseReleaseEvent.
Definition TableViewHeader.cpp:283
void updateHeaderOffset(int)
Updates the header offset.
Definition TableViewHeader.cpp:203
void updateRebuildProgressRange(int min, int max)
Updates the range of the rebuild progress.
Definition TableViewHeader.cpp:656
void setModel(AbstractTableModel *someModel)
Connects the table model to the functions that handle changes.
Definition TableViewHeader.cpp:114
void updateSortProgress(int newProgress)
Updates the current sort progress value.
Definition TableViewHeader.cpp:668
QSize sizeHint() const
Returns the minimum size based on the font.
Definition TableViewHeader.cpp:104
void updateSortProgressRange(int min, int max)
Updates the range of the sort progress.
Definition TableViewHeader.cpp:680
virtual ~TableViewHeader()
Destructor.
Definition TableViewHeader.cpp:70
void updateRebuildProgress(int newProgress)
Updates the current rebuild progress value.
Definition TableViewHeader.cpp:644
QSize minimumSizeHint() const
Returns the minimum size based on the font.
Definition TableViewHeader.cpp:90
void sortingEnabled(bool)
void columnResized(bool lastColumn)
void mousePressEvent(QMouseEvent *event)
Overrides QWidget::mousePressEvent.
Definition TableViewHeader.cpp:214
virtual void setColumns(TableColumnList *)
Sets the column list.
Definition TableViewHeader.cpp:80
void requestedGlobalSelection(bool select)
TableViewHeader(AbstractTableModel *someModel)
Constructor.
Definition TableViewHeader.cpp:39
void paintEvent(QPaintEvent *event)
Repaints the header.
Definition TableViewHeader.cpp:323
void requestedColumnSelection(int columnNum, bool select)
void handleFilterCountsChanged(int visibleTopLevelItemCount, int topLevelItemCount)
Updates the visible columns, and geometry when the filter count changes.
Definition TableViewHeader.cpp:177
void updateFilterProgress(int newProgress)
Updates the current filter progress value.
Definition TableViewHeader.cpp:620
This is free and unencumbered software released into the public domain.
Definition BoxcarCachingAlgorithm.h:13
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16