Isis 3 Programmer Reference
|
#include <TableViewContent.h>
Public Slots | |
void | scrollTo (QList< AbstractTreeItem * >) |
Scrolls to the selected items. More... | |
void | scrollTo (AbstractTreeItem *) |
Scrolls to the selected item. More... | |
void | refresh () |
Refreshes the table and viewport. More... | |
void | updateHorizontalScrollBar (bool scrollRight=false) |
Updates the horizontal scroll bar. More... | |
Signals | |
void | rebuildModels (QList< AbstractTreeItem * >) |
void | modelDataChanged () |
void | tableSelectionChanged () |
void | tableSelectionChanged (QList< AbstractTreeItem * >) |
void | horizontalScrollBarValueChanged (int) |
void | editControlPoint (ControlPoint *controlPoint, QString serialNumber) |
Public Member Functions | |
TableViewContent (AbstractTableModel *someModel) | |
Constructor. More... | |
virtual | ~TableViewContent () |
Destructor. More... | |
QSize | minimumSizeHint () const |
Returns the minimum size hint. More... | |
QSize | sizeHint () const |
Returns the minimum size hint. More... | |
AbstractTableModel * | getModel () |
Returns the model. More... | |
void | setActiveControlNet (bool activeNet) |
Sets if there is an active control net. More... | |
Protected Member Functions | |
bool | eventFilter (QObject *target, QEvent *event) |
Overrides QObject::eventFilter. More... | |
void | keyPressEvent (QKeyEvent *event) |
Overrides QWidget::keyPressEvent. More... | |
void | leaveEvent (QEvent *event) |
Overrides QWidget::leaveEvent. More... | |
void | mouseDoubleClickEvent (QMouseEvent *event) |
Overrides QWidget::mouseDoubleClickEvent. More... | |
void | mouseMoveEvent (QMouseEvent *event) |
Overrides QWidget::mouseMoveEvent. More... | |
void | mousePressEvent (QMouseEvent *event) |
Overrides QWidget::mousePressEvent. More... | |
void | mouseReleaseEvent (QMouseEvent *event) |
Overrides QWidget::mouseReleaseEvent. More... | |
void | paintEvent (QPaintEvent *event) |
Paints the table when there is a paint event. More... | |
void | resizeEvent (QResizeEvent *event) |
Updates the table when it is resized. More... | |
void | scrollContentsBy (int dx, int dy) |
Updates the item list when the user scrolls. More... | |
Private Slots | |
void | copySelection () |
Copies selected cells. More... | |
void | copyAll () |
Copies all of the cells. More... | |
void | deleteSelectedRows () |
Deletes the selected rows. More... | |
void | editControlPoint () |
Retrieves the control point from the selected cells for editing. More... | |
void | updateItemList () |
Updates the item list. More... | |
void | showContextMenu (QPoint) |
Populates the context menus based on where the user clicked. More... | |
Private Member Functions | |
TableViewContent (const TableViewContent &other) | |
TableViewContent & | operator= (const TableViewContent &other) |
void | nullify () |
Clears all member variables. More... | |
void | cellDataChanged (TableColumn const *col) |
Rebuilds the models when the data is changed. More... | |
void | clearActiveCell () |
Clears the active cell. More... | |
void | clearColumnSelection () |
Clears the selected column. More... | |
void | copyCellSelection (bool) |
Copies the selected cells. More... | |
void | createActions () |
Builds the menus. More... | |
void | selectAllRows () |
int | getColumnFromScreenX (int screenX) const |
Calculates the visible range of a column and returns the index of the column. More... | |
int | getRowFromScreenY (int screenY) const |
Calculates the visible range of a row and returns the index of the column. More... | |
bool | hasActiveCell () const |
Checks if there is an active cell. More... | |
bool | hasRowSelection () const |
Checks if there is a row selected. More... | |
bool | mouseInCellSelection (QPoint) const |
Checks if the mouse is in the selected cells. More... | |
bool | mouseInRowSelection (QPoint) const |
Checks if the mouse is in the selected row. More... | |
bool | rowIsValid (int rowNum) const |
Checks if the row number is valid. More... | |
bool | columnIsValid (int colNum) const |
Checks if the column number is valid. More... | |
bool | cellIsEditable (int, int) const |
Checks if the cell is editable. More... | |
bool | isDataColumn (int) const |
Checks if the column has a non empty title. More... | |
void | paintRow (QPainter *, int, QPoint, QPoint) |
Repaints the row. More... | |
void | updateActiveCell (QPoint) |
Updates which cell is active. More... | |
void | updateHoveredCell (QPoint, bool) |
void | updateColumnGroupSelection (AbstractTreeItem *) |
Updates which column is selected. More... | |
QList< AbstractTreeItem * > | updateRowGroupSelection (int lastRow) |
Updates which row is selected. More... | |
void | finishEditing () |
Saves the data from the cell the user was modifying. More... | |
void | moveActiveCellDown () |
Changes the viewport when the active cell is moved. More... | |
void | moveActiveCellUp () |
Shifts the active cell up. More... | |
void | moveActiveCellLeft () |
Changes the viewport when the active cell is moved. More... | |
void | moveActiveCellRight () |
Changes the viewport when the active cell is moved. More... | |
Private Attributes | |
TableView * | m_parentView |
AbstractTableModel * | m_model |
QList< QPointer< AbstractTreeItem > > * | m_items |
TableColumnList * | m_columns |
QPair< AbstractTreeItem *, int > * | m_activeCell |
QPair< AbstractTreeItem *, int > * | m_lastShiftArrowSelectedCell |
bool | m_lastShiftArrowDirectionUp |
QList< AbstractTreeItem * > * | rowsWithActiveColumnSelected |
Stores a list of the rows that have their active column cells selected. More... | |
QWidget * | m_editWidget |
AbstractTreeItem * | m_lastDirectlySelectedRow |
This is the last row that was selected by either a control-click or normal click. More... | |
QList< AbstractTreeItem * > * | m_lastShiftSelection |
int | m_rowHeight |
QAction * | m_applyToSelectionAct |
This action applies (copies) the contents of the active cell to the current selection. More... | |
QAction * | m_applyToAllAct |
This action applies (copies) the contents of the active cell to all of the cells in the active cell's column. More... | |
QAction * | m_deleteSelectedRowsAct |
This action deletes the selected rows. More... | |
QAction * | m_editControlPointAct |
This action edits selected control point or if measure selected, edit parent control pt. More... | |
bool | m_activeControlNet |
Static Private Attributes | |
static const int | ITEM_PADDING = 7 |
static const int | ITEM_INDENTATION = 3 |
Definition at line 60 of file TableViewContent.h.
Isis::TableViewContent::TableViewContent | ( | AbstractTableModel * | someModel | ) |
Constructor.
someModel | The abstract table model |
Definition at line 51 of file TableViewContent.cpp.
References createActions(), getModel(), nullify(), refresh(), rowsWithActiveColumnSelected, scrollTo(), showContextMenu(), updateHorizontalScrollBar(), and updateItemList().
|
virtual |
Destructor.
Definition at line 108 of file TableViewContent.cpp.
References m_applyToAllAct, m_applyToSelectionAct, m_deleteSelectedRowsAct, and m_editControlPointAct.
|
private |
Rebuilds the models when the data is changed.
col | The table column that changed |
Definition at line 1030 of file TableViewContent.cpp.
Referenced by copyCellSelection(), finishEditing(), and updateActiveCell().
|
private |
Checks if the cell is editable.
rowNum | The cell's row |
colNum | The cell's column |
Definition at line 1276 of file TableViewContent.cpp.
Referenced by keyPressEvent(), mouseDoubleClickEvent(), mouseMoveEvent(), mousePressEvent(), and paintRow().
|
private |
Clears the active cell.
Definition at line 1041 of file TableViewContent.cpp.
Referenced by keyPressEvent(), mousePressEvent(), and updateActiveCell().
|
private |
Clears the selected column.
Definition at line 1050 of file TableViewContent.cpp.
References rowsWithActiveColumnSelected.
Referenced by keyPressEvent(), mouseMoveEvent(), mousePressEvent(), moveActiveCellDown(), moveActiveCellLeft(), moveActiveCellRight(), moveActiveCellUp(), refresh(), and updateActiveCell().
|
private |
Checks if the column number is valid.
colNum | Column to check |
Definition at line 1258 of file TableViewContent.cpp.
|
privateslot |
Copies all of the cells.
Definition at line 1592 of file TableViewContent.cpp.
References copyCellSelection().
Referenced by createActions().
|
private |
Copies the selected cells.
allCells | Determines if all of the visible rows should be copied |
Definition at line 1062 of file TableViewContent.cpp.
References cellDataChanged(), hasActiveCell(), and rowsWithActiveColumnSelected.
Referenced by copyAll(), and copySelection().
|
privateslot |
Copies selected cells.
Definition at line 1582 of file TableViewContent.cpp.
References copyCellSelection().
Referenced by createActions().
|
private |
Builds the menus.
Definition at line 1116 of file TableViewContent.cpp.
References copyAll(), copySelection(), deleteSelectedRows(), editControlPoint(), m_applyToAllAct, m_applyToSelectionAct, m_deleteSelectedRowsAct, and m_editControlPointAct.
Referenced by TableViewContent().
|
privateslot |
Deletes the selected rows.
Definition at line 1600 of file TableViewContent.cpp.
Referenced by createActions(), and keyPressEvent().
|
privateslot |
Retrieves the control point from the selected cells for editing.
Definition at line 1621 of file TableViewContent.cpp.
References m_lastDirectlySelectedRow.
Referenced by createActions().
|
protected |
Overrides QObject::eventFilter.
target | The object that was changed |
event | The event that was triggered |
Definition at line 315 of file TableViewContent.cpp.
|
private |
Saves the data from the cell the user was modifying.
Definition at line 768 of file TableViewContent.cpp.
References cellDataChanged(), and getModel().
Referenced by keyPressEvent().
|
private |
Calculates the visible range of a column and returns the index of the column.
screenX | X value of the screen size |
Definition at line 1150 of file TableViewContent.cpp.
References Isis::TableColumnList::getVisibleXRange().
Referenced by mouseInCellSelection(), mouseMoveEvent(), mousePressEvent(), moveActiveCellLeft(), and moveActiveCellRight().
AbstractTableModel * Isis::TableViewContent::getModel | ( | ) |
Returns the model.
Definition at line 167 of file TableViewContent.cpp.
Referenced by Isis::TableView::displayWarning(), finishEditing(), Isis::TableView::getModel(), keyPressEvent(), moveActiveCellDown(), moveActiveCellUp(), scrollTo(), and TableViewContent().
|
private |
Calculates the visible range of a row and returns the index of the column.
screenY | Y value of the screen size |
Definition at line 1173 of file TableViewContent.cpp.
Referenced by mouseInCellSelection(), mouseInRowSelection(), and updateActiveCell().
|
private |
Checks if there is an active cell.
Definition at line 1189 of file TableViewContent.cpp.
Referenced by copyCellSelection(), keyPressEvent(), and showContextMenu().
|
private |
Checks if there is a row selected.
Definition at line 1199 of file TableViewContent.cpp.
Referenced by keyPressEvent(), and showContextMenu().
|
private |
Checks if the column has a non empty title.
colNum | The column to check |
Definition at line 1299 of file TableViewContent.cpp.
|
protected |
Overrides QWidget::keyPressEvent.
event | QMouseEvent |
Definition at line 563 of file TableViewContent.cpp.
References cellIsEditable(), clearActiveCell(), clearColumnSelection(), deleteSelectedRows(), finishEditing(), getModel(), hasActiveCell(), hasRowSelection(), moveActiveCellDown(), moveActiveCellLeft(), moveActiveCellRight(), moveActiveCellUp(), rowsWithActiveColumnSelected, and scrollTo().
|
protected |
Overrides QWidget::leaveEvent.
event | QMouseEvent |
Definition at line 553 of file TableViewContent.cpp.
QSize Isis::TableViewContent::minimumSizeHint | ( | ) | const |
Returns the minimum size hint.
Definition at line 145 of file TableViewContent.cpp.
Referenced by sizeHint().
|
protected |
Overrides QWidget::mouseDoubleClickEvent.
event | QMouseEvent |
Definition at line 325 of file TableViewContent.cpp.
References cellIsEditable().
|
private |
Checks if the mouse is in the selected cells.
mousePos | Mouse position |
Definition at line 1211 of file TableViewContent.cpp.
References getColumnFromScreenX(), getRowFromScreenY(), and rowsWithActiveColumnSelected.
Referenced by showContextMenu().
|
private |
Checks if the mouse is in the selected row.
mousePos | Mouse position |
Definition at line 1227 of file TableViewContent.cpp.
References getRowFromScreenY().
Referenced by showContextMenu().
|
protected |
Overrides QWidget::mouseMoveEvent.
event | QMouseEvent |
Definition at line 487 of file TableViewContent.cpp.
References cellIsEditable(), clearColumnSelection(), getColumnFromScreenX(), updateColumnGroupSelection(), and updateRowGroupSelection().
|
protected |
Overrides QWidget::mousePressEvent.
event | QMouseEvent |
Definition at line 352 of file TableViewContent.cpp.
References cellIsEditable(), clearActiveCell(), clearColumnSelection(), getColumnFromScreenX(), m_lastDirectlySelectedRow, rowsWithActiveColumnSelected, updateActiveCell(), updateColumnGroupSelection(), and updateRowGroupSelection().
|
protected |
Overrides QWidget::mouseReleaseEvent.
Empty function
event | QMouseEvent |
Definition at line 478 of file TableViewContent.cpp.
|
private |
Changes the viewport when the active cell is moved.
Definition at line 806 of file TableViewContent.cpp.
References clearColumnSelection(), and getModel().
Referenced by keyPressEvent().
|
private |
Changes the viewport when the active cell is moved.
Definition at line 827 of file TableViewContent.cpp.
References clearColumnSelection(), and getColumnFromScreenX().
Referenced by keyPressEvent().
|
private |
Changes the viewport when the active cell is moved.
Definition at line 843 of file TableViewContent.cpp.
References clearColumnSelection(), and getColumnFromScreenX().
Referenced by keyPressEvent().
|
private |
Shifts the active cell up.
Definition at line 786 of file TableViewContent.cpp.
References clearColumnSelection(), and getModel().
Referenced by keyPressEvent().
|
private |
Clears all member variables.
Definition at line 1007 of file TableViewContent.cpp.
References m_applyToAllAct, m_applyToSelectionAct, m_deleteSelectedRowsAct, m_editControlPointAct, m_lastDirectlySelectedRow, and rowsWithActiveColumnSelected.
Referenced by TableViewContent().
|
protected |
Paints the table when there is a paint event.
Overrides QWidget::paintEvent
event | The paint event |
Definition at line 862 of file TableViewContent.cpp.
References Isis::TableColumnList::getVisibleXRange(), and paintRow().
|
private |
Repaints the row.
painter | The QPainter |
rowNum | The row to repaint |
absolutePosition | The row position |
relativePosition | The row position in the visible area |
Definition at line 1313 of file TableViewContent.cpp.
References cellIsEditable(), Isis::ControlPoint::GetRefMeasure(), Isis::TableColumnList::getVisibleXRange(), and rowsWithActiveColumnSelected.
Referenced by paintEvent().
|
slot |
Refreshes the table and viewport.
Definition at line 224 of file TableViewContent.cpp.
References clearColumnSelection(), m_lastDirectlySelectedRow, rowsWithActiveColumnSelected, and updateItemList().
Referenced by Isis::TableView::handleModelSelectionChanged(), and TableViewContent().
|
protected |
Updates the table when it is resized.
event | Resize event |
Definition at line 985 of file TableViewContent.cpp.
References updateHorizontalScrollBar(), and updateItemList().
|
private |
Checks if the row number is valid.
rowNum | Row to check |
Definition at line 1241 of file TableViewContent.cpp.
|
protected |
Updates the item list when the user scrolls.
dx | X scroll |
dy | Y scroll |
Definition at line 998 of file TableViewContent.cpp.
References updateItemList().
|
slot |
Scrolls to the selected item.
newlySelectedItem | Newly selected item to scroll to |
Definition at line 286 of file TableViewContent.cpp.
References getModel().
|
slot |
Scrolls to the selected items.
newlySelectedItems | Newly selected items to scroll to |
Definition at line 274 of file TableViewContent.cpp.
Referenced by keyPressEvent(), and TableViewContent().
void Isis::TableViewContent::setActiveControlNet | ( | bool | activeNet | ) |
Sets if there is an active control net.
bool | The bool if there is an active control net |
Definition at line 216 of file TableViewContent.cpp.
Referenced by Isis::Directory::addCnetEditorView(), and Isis::Directory::newActiveControl().
|
privateslot |
Populates the context menus based on where the user clicked.
mouseLocation | Location of the mouse |
Definition at line 1677 of file TableViewContent.cpp.
References hasActiveCell(), hasRowSelection(), m_applyToAllAct, m_applyToSelectionAct, m_deleteSelectedRowsAct, m_editControlPointAct, mouseInCellSelection(), mouseInRowSelection(), and rowsWithActiveColumnSelected.
Referenced by TableViewContent().
QSize Isis::TableViewContent::sizeHint | ( | ) | const |
Returns the minimum size hint.
Definition at line 157 of file TableViewContent.cpp.
References minimumSizeHint().
|
private |
Updates which cell is active.
screenPos | The position of the active cell |
Definition at line 1460 of file TableViewContent.cpp.
References cellDataChanged(), clearActiveCell(), clearColumnSelection(), getRowFromScreenY(), Isis::TableColumnList::getVisibleXRange(), m_lastDirectlySelectedRow, and Isis::IException::what().
Referenced by mousePressEvent().
|
private |
Updates which column is selected.
item | The new selected group |
Definition at line 1513 of file TableViewContent.cpp.
References m_lastDirectlySelectedRow, and rowsWithActiveColumnSelected.
Referenced by mouseMoveEvent(), and mousePressEvent().
|
slot |
Updates the horizontal scroll bar.
scrollRight | True if the horizontal scroll bar has scrolled right |
Definition at line 251 of file TableViewContent.cpp.
Referenced by resizeEvent(), and TableViewContent().
|
privateslot |
Updates the item list.
Definition at line 1655 of file TableViewContent.cpp.
Referenced by refresh(), resizeEvent(), scrollContentsBy(), and TableViewContent().
|
private |
Updates which row is selected.
lastRow | The index of the last row |
Definition at line 1543 of file TableViewContent.cpp.
References m_lastDirectlySelectedRow.
Referenced by mouseMoveEvent(), and mousePressEvent().
|
private |
This action applies (copies) the contents of the active cell to all of the cells in the active cell's column.
Definition at line 184 of file TableViewContent.h.
Referenced by createActions(), nullify(), showContextMenu(), and ~TableViewContent().
|
private |
This action applies (copies) the contents of the active cell to the current selection.
Definition at line 178 of file TableViewContent.h.
Referenced by createActions(), nullify(), showContextMenu(), and ~TableViewContent().
|
private |
This action deletes the selected rows.
Definition at line 189 of file TableViewContent.h.
Referenced by createActions(), nullify(), showContextMenu(), and ~TableViewContent().
|
private |
This action edits selected control point or if measure selected, edit parent control pt.
Definition at line 194 of file TableViewContent.h.
Referenced by createActions(), nullify(), showContextMenu(), and ~TableViewContent().
|
private |
This is the last row that was selected by either a control-click or normal click.
Definition at line 170 of file TableViewContent.h.
Referenced by editControlPoint(), mousePressEvent(), nullify(), refresh(), updateActiveCell(), updateColumnGroupSelection(), and updateRowGroupSelection().
|
private |
Stores a list of the rows that have their active column cells selected.
Definition at line 162 of file TableViewContent.h.
Referenced by clearColumnSelection(), copyCellSelection(), keyPressEvent(), mouseInCellSelection(), mousePressEvent(), nullify(), paintRow(), refresh(), showContextMenu(), TableViewContent(), and updateColumnGroupSelection().