Isis 3.0 Programmer Reference
Back | Home
TableViewContent.h
1 #ifndef TableViewContent_H
2 #define TableViewContent_H
3 
4 #include <QAbstractScrollArea>
5 
6 #include <QPointer>
7 
8 
9 class QAction;
10 class QEvent;
11 class QKeyEvent;
12 template< typename T > class QList;
13 class QMenu;
14 class QMouseEvent;
15 class QPoint;
16 class QResizeEvent;
17 
18 
19 namespace Isis {
20  namespace CnetViz {
21  class AbstractTableModel;
22  class AbstractTreeItem;
23  class TableColumn;
24  class TableColumnList;
25  class TableView;
26 
34  Q_OBJECT
35 
36  public:
38  virtual ~TableViewContent();
39  QSize minimumSizeHint() const;
40  QSize sizeHint() const;
41  AbstractTableModel *getModel();
42  // void setModel(AbstractTableModel * someModel);
43 
44 
45  signals:
46  void rebuildModels(QList< CnetViz::AbstractTreeItem * >);
47  void modelDataChanged();
48  void tableSelectionChanged();
49  void tableSelectionChanged(QList< AbstractTreeItem * >);
50  void horizontalScrollBarValueChanged(int);
51 
52 
53  public slots:
54  void scrollTo(QList< AbstractTreeItem * >);
55  void scrollTo(AbstractTreeItem *);
56  void refresh();
57  void updateHorizontalScrollBar(bool scrollRight = false);
58 
59 
60  protected:
61  bool eventFilter(QObject *target, QEvent *event);
62  void keyPressEvent(QKeyEvent *event);
63  void leaveEvent(QEvent *event);
64  void mouseDoubleClickEvent(QMouseEvent *event);
65  void mouseMoveEvent(QMouseEvent *event);
66  void mousePressEvent(QMouseEvent *event);
67  void mouseReleaseEvent(QMouseEvent *event);
68  void paintEvent(QPaintEvent *event);
69  void resizeEvent(QResizeEvent *event);
70  void scrollContentsBy(int dx, int dy);
71 
72 
73  private:
74  TableViewContent(const TableViewContent &other);
75  TableViewContent &operator=(const TableViewContent &other);
76 
77 
78  private:
79  void nullify();
80  void cellDataChanged(TableColumn const *col);
81  void clearActiveCell();
82  void clearColumnSelection();
83  void copyCellSelection(bool);
84  void createActions();
85  void selectAllRows();
86  int getColumnFromScreenX(int screenX) const;
87  int getRowFromScreenY(int screenY) const;
88  bool hasActiveCell() const;
89  bool hasRowSelection() const;
90  bool mouseInCellSelection(QPoint) const;
91  bool mouseInRowSelection(QPoint) const;
92  bool rowIsValid(int rowNum) const;
93  bool columnIsValid(int colNum) const;
94  bool cellIsEditable(int, int) const;
95  bool isDataColumn(int) const;
96  void paintRow(QPainter *, int, QPoint, QPoint);
97  void updateActiveCell(QPoint);
98  void updateHoveredCell(QPoint, bool);
99  void updateColumnGroupSelection(AbstractTreeItem *);
100  QList< AbstractTreeItem * > updateRowGroupSelection(int lastRow);
101  void finishEditing();
102  void moveActiveCellDown();
103  void moveActiveCellUp();
104  void moveActiveCellLeft();
105  void moveActiveCellRight();
106 
107 
108  private slots:
109  void copySelection();
110  void copyAll();
111  void deleteSelectedRows();
112  void updateItemList();
113  void showContextMenu(QPoint);
114 
115 
116  private:
117  TableView *m_parentView;
118  AbstractTableModel *m_model;
120  TableColumnList *m_columns;
121 
122  QPair< AbstractTreeItem *, int > * m_activeCell;
123 
124  QPair< AbstractTreeItem *, int > * m_lastShiftArrowSelectedCell;
125  bool m_lastShiftArrowDirectionUp;
126 
132 
133  QWidget *m_editWidget;
134 
140  QList< AbstractTreeItem * > * m_lastShiftSelection;
141  QPoint *m_mousePressPos;
142  int m_rowHeight;
143 
149 
155 
160 
161 
162  private:
163  static const int ITEM_PADDING = 7;
164  static const int ITEM_INDENTATION = 3;
165  };
166  }
167 }
168 
169 #endif
QAction * m_deleteSelectedRowsAct
This action deletes the selected rows.
Translates the tree model into a table model.
QAction * m_applyToSelectionAct
This action applies (copies) the contents of the active cell to the current selection.
Base class for an item in the tree.
QAction * m_applyToAllAct
This action applies (copies) the contents of the active cell to all of the cells in the active cell&#39;s...
AbstractTreeItem * m_lastDirectlySelectedRow
This is the last row that was selected by either a control-click or normal click. ...
QList< AbstractTreeItem * > * rowsWithActiveColumnSelected
Stores a list of the rows that have their active column cells selected.

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:30:30