Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Isis Developer Reference
TableViewHeader.h
Go to the documentation of this file.
1#ifndef TableViewHeader_H
2#define TableViewHeader_H
3
9
10/* SPDX-License-Identifier: CC0-1.0 */
11
12#include <QWidget>
13
14class QMouseEvent;
15class QPainter;
16class QPaintEvent;
17class QSize;
18template<typename T> class QList;
19
20
21namespace Isis {
23 class TableColumnList;
24
33 class TableViewHeader : public QWidget {
34
35 Q_OBJECT
36
37 public:
38 explicit TableViewHeader(AbstractTableModel *someModel);
39 virtual ~TableViewHeader();
40 virtual void setColumns(TableColumnList *);
41 QSize minimumSizeHint() const;
42 QSize sizeHint() const;
43
44 void setModel(AbstractTableModel *someModel);
45
46
47 signals:
48 void columnResized(bool lastColumn);
49 void requestedGlobalSelection(bool select);
50 void requestedColumnSelection(int columnNum, bool select);
51 void sortingEnabled(bool);
52
53
54 public slots:
55 void handleFilterCountsChanged(int visibleTopLevelItemCount,
56 int topLevelItemCount);
57 void updateHeaderOffset(int);
58 void updateFilterProgress(int newProgress);
59 void updateFilterProgressRange(int min, int max);
60 void updateRebuildProgress(int newProgress);
61 void updateRebuildProgressRange(int min, int max);
62 void updateSortProgress(int newProgress);
63 void updateSortProgressRange(int min, int max);
64
65
66 protected:
67 void mouseMoveEvent(QMouseEvent *event);
68 void mousePressEvent(QMouseEvent *event);
69 void mouseReleaseEvent(QMouseEvent *event);
70 void paintEvent(QPaintEvent *event);
71
72
73 private: // methods
74 TableViewHeader(const TableViewHeader &other);
75 TableViewHeader &operator=(TableViewHeader other);
76 void nullify();
77 QRect getColumnRect(int column) const;
78 int getMousedColumn(QPoint mousePos);
79 int getMousedColumnEdge(QPoint mousePos);
80 bool mouseAtResizableColumnEdge(QPoint mousePos);
81 void paintHeader(QPainter *painter, int rowheight);
82 void paintProgress(QPainter *painter, const QRect &rect, int min,
83 int max, int value, bool over100);
84 QRect getSortingPriorityRect(int visColIndex);
85 QRect getSortingArrowRect(int visColIndex);
86
87
88 private: // data
89 TableColumnList *m_columns;
90 int m_horizontalOffset;
91 int m_filterProgress;
92 int m_filterProgressMin;
93 int m_filterProgressMax;
94 int m_rebuildProgress;
95 int m_rebuildProgressMin;
96 int m_rebuildProgressMax;
97 int m_sortProgress;
98 int m_sortProgressMin;
99 int m_sortProgressMax;
100
101 int m_visibleCount;
102 int m_totalCount;
103
104 int m_clickedColumnEdge;
105 int m_clickedColumn;
106
107 static int const SORT_ARROW_MARGIN = 10;
108 int ARROW_HEIGHT;
109 int ARROW_WIDTH;
110
111 AbstractTableModel *m_model;
112 };
113}
114
115
116#endif
Translates the tree model into a table model.
Definition AbstractTableModel.h:48
Definition TableColumnList.h:27
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