Isis 3 Programmer Reference
Isis::TableViewHeader Class Reference

#include <TableViewHeader.h>

Inheritance diagram for Isis::TableViewHeader:
Inheritance graph
Collaboration diagram for Isis::TableViewHeader:
Collaboration graph

Public Slots

void handleFilterCountsChanged (int visibleTopLevelItemCount, int topLevelItemCount)
 Updates the visible columns, and geometry when the filter count changes. More...
 
void updateHeaderOffset (int)
 Updates the header offset. More...
 
void updateFilterProgress (int newProgress)
 Updates the current filter progress value. More...
 
void updateFilterProgressRange (int min, int max)
 Updates the range of the filter progress. More...
 
void updateRebuildProgress (int newProgress)
 Updates the current rebuild progress value. More...
 
void updateRebuildProgressRange (int min, int max)
 Updates the range of the rebuild progress. More...
 
void updateSortProgress (int newProgress)
 Updates the current sort progress value. More...
 
void updateSortProgressRange (int min, int max)
 Updates the range of the sort progress. More...
 

Signals

void columnResized (bool lastColumn)
 
void requestedGlobalSelection (bool select)
 
void requestedColumnSelection (int columnNum, bool select)
 
void sortingEnabled (bool)
 

Public Member Functions

 TableViewHeader (AbstractTableModel *someModel)
 Constructor. More...
 
virtual ~TableViewHeader ()
 Destructor. More...
 
virtual void setColumns (TableColumnList *)
 Sets the column list. More...
 
QSize minimumSizeHint () const
 Returns the minimum size based on the font. More...
 
QSize sizeHint () const
 Returns the minimum size based on the font. More...
 
void setModel (AbstractTableModel *someModel)
 Connects the table model to the functions that handle changes. More...
 

Protected Member Functions

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)
 Repaints the header. More...
 

Private Member Functions

 TableViewHeader (const TableViewHeader &other)
 
TableViewHeaderoperator= (TableViewHeader other)
 
void nullify ()
 Sets all the member variables to NULL. More...
 
QRect getColumnRect (int column) const
 Returns the visible column rectangle. More...
 
int getMousedColumn (QPoint mousePos)
 Returns the column under the mouse. More...
 
int getMousedColumnEdge (QPoint mousePos)
 Returns the edge of the column under the mouse. More...
 
bool mouseAtResizableColumnEdge (QPoint mousePos)
 Returns if the mouse is at the edge of a resizeable column. More...
 
void paintHeader (QPainter *painter, int rowheight)
 Repaints the header. More...
 
void paintProgress (QPainter *painter, const QRect &rect, int min, int max, int value, bool over100)
 Updates the progress bar. More...
 
QRect getSortingPriorityRect (int visColIndex)
 
QRect getSortingArrowRect (int visColIndex)
 

Private Attributes

TableColumnListm_columns
 
int m_horizontalOffset
 
int m_filterProgress
 
int m_filterProgressMin
 
int m_filterProgressMax
 
int m_rebuildProgress
 
int m_rebuildProgressMin
 
int m_rebuildProgressMax
 
int m_sortProgress
 
int m_sortProgressMin
 
int m_sortProgressMax
 
int m_visibleCount
 
int m_totalCount
 
int m_clickedColumnEdge
 
int m_clickedColumn
 
int ARROW_HEIGHT
 
int ARROW_WIDTH
 
AbstractTableModelm_model
 

Static Private Attributes

static int const SORT_ARROW_MARGIN = 10
 

Detailed Description

Author
????-??-?? Unknown
History:

2012-09-28 Kimberly Oyama - Changed member variables to be prefixed with "m_".

2017-07-25 Summer Stapleton - Removed the CnetViz namespace. Fixes #5054.

2017-08-08 Makayla Shepherd - Updated documentation.

Definition at line 26 of file TableViewHeader.h.

Constructor & Destructor Documentation

◆ TableViewHeader()

Isis::TableViewHeader::TableViewHeader ( AbstractTableModel someModel)
explicit

Constructor.

Parameters
someModelThe table model

Definition at line 33 of file TableViewHeader.cpp.

References nullify(), and setModel().

◆ ~TableViewHeader()

Isis::TableViewHeader::~TableViewHeader ( )
virtual

Destructor.

Definition at line 64 of file TableViewHeader.cpp.

Member Function Documentation

◆ getColumnRect()

QRect Isis::TableViewHeader::getColumnRect ( int  column) const
private

Returns the visible column rectangle.

Parameters
columnColumn to check
Returns
QRect The visible column rectangle

Definition at line 348 of file TableViewHeader.cpp.

Referenced by getMousedColumn(), getMousedColumnEdge(), mouseAtResizableColumnEdge(), mouseMoveEvent(), and paintHeader().

◆ getMousedColumn()

int Isis::TableViewHeader::getMousedColumn ( QPoint  mousePos)
private

Returns the column under the mouse.

Parameters
mousePosThe mouse position
Returns
int Index of the column under the mouse

Definition at line 374 of file TableViewHeader.cpp.

References getColumnRect().

Referenced by getMousedColumnEdge(), mouseAtResizableColumnEdge(), mousePressEvent(), and mouseReleaseEvent().

◆ getMousedColumnEdge()

int Isis::TableViewHeader::getMousedColumnEdge ( QPoint  mousePos)
private

Returns the edge of the column under the mouse.

Parameters
mousePosThe mouse position
Returns
int Index of the column edge under the mouse

Definition at line 396 of file TableViewHeader.cpp.

References getColumnRect(), getMousedColumn(), and mouseAtResizableColumnEdge().

Referenced by mousePressEvent().

◆ handleFilterCountsChanged

void Isis::TableViewHeader::handleFilterCountsChanged ( int  visibleTopLevelItemCount,
int  topLevelItemCount 
)
slot

Updates the visible columns, and geometry when the filter count changes.

Parameters
visibleTopLevelItemCountNumber of visible top level items
topLevelItemCountNumber of top level items

Definition at line 171 of file TableViewHeader.cpp.

Referenced by setModel().

◆ minimumSizeHint()

QSize Isis::TableViewHeader::minimumSizeHint ( ) const

Returns the minimum size based on the font.

Returns
QSize Minimum size allowed

Definition at line 84 of file TableViewHeader.cpp.

Referenced by sizeHint().

◆ mouseAtResizableColumnEdge()

bool Isis::TableViewHeader::mouseAtResizableColumnEdge ( QPoint  mousePos)
private

Returns if the mouse is at the edge of a resizeable column.

Parameters
mousePosThe mouse position
Returns
bool True if the mouse is at the edge fo a resizable column

Definition at line 423 of file TableViewHeader.cpp.

References getColumnRect(), and getMousedColumn().

Referenced by getMousedColumnEdge(), and mouseMoveEvent().

◆ mouseMoveEvent()

void Isis::TableViewHeader::mouseMoveEvent ( QMouseEvent *  event)
protected

Overrides QWidget::mouseMoveEvent.

Parameters
eventThe mouse move event

Definition at line 241 of file TableViewHeader.cpp.

References getColumnRect(), and mouseAtResizableColumnEdge().

◆ mousePressEvent()

void Isis::TableViewHeader::mousePressEvent ( QMouseEvent *  event)
protected

Overrides QWidget::mousePressEvent.

Parameters
eventThe mouse press event

Definition at line 208 of file TableViewHeader.cpp.

References getMousedColumn(), and getMousedColumnEdge().

◆ mouseReleaseEvent()

void Isis::TableViewHeader::mouseReleaseEvent ( QMouseEvent *  event)
protected

Overrides QWidget::mouseReleaseEvent.

Parameters
eventThe mouse release event

Definition at line 277 of file TableViewHeader.cpp.

References getMousedColumn().

◆ nullify()

void Isis::TableViewHeader::nullify ( )
private

Sets all the member variables to NULL.

Definition at line 335 of file TableViewHeader.cpp.

Referenced by TableViewHeader().

◆ paintEvent()

void Isis::TableViewHeader::paintEvent ( QPaintEvent *  event)
protected

Repaints the header.

Parameters
eventThe paint event

Definition at line 317 of file TableViewHeader.cpp.

References paintHeader().

◆ paintHeader()

void Isis::TableViewHeader::paintHeader ( QPainter *  painter,
int  rowHeight 
)
private

Repaints the header.

Parameters
painterThe QPainter
rowHeightThe new row height

Definition at line 456 of file TableViewHeader.cpp.

References getColumnRect(), and paintProgress().

Referenced by paintEvent().

◆ paintProgress()

void Isis::TableViewHeader::paintProgress ( QPainter *  painter,
const QRect &  rect,
int  min,
int  max,
int  value,
bool  over100 
)
private

Updates the progress bar.

Parameters
painterThe QPainter
rectThe progress bar
minThe minimum progress value
maxThe maximum progress value
valueCurrent progress value
over100Bool if the progress can go over 100

Definition at line 599 of file TableViewHeader.cpp.

Referenced by paintHeader().

◆ setColumns()

void Isis::TableViewHeader::setColumns ( TableColumnList cols)
virtual

Sets the column list.

Parameters
colsThe column list

Definition at line 74 of file TableViewHeader.cpp.

◆ setModel()

void Isis::TableViewHeader::setModel ( AbstractTableModel someModel)

Connects the table model to the functions that handle changes.

Parameters
someModelThe table model to connect

Definition at line 108 of file TableViewHeader.cpp.

References handleFilterCountsChanged(), updateFilterProgress(), updateFilterProgressRange(), updateRebuildProgress(), updateRebuildProgressRange(), updateSortProgress(), and updateSortProgressRange().

Referenced by TableViewHeader().

◆ sizeHint()

QSize Isis::TableViewHeader::sizeHint ( ) const

Returns the minimum size based on the font.

See also
minimumSizeHint
Returns
QSize Minimum size allowed

Definition at line 98 of file TableViewHeader.cpp.

References minimumSizeHint().

◆ updateFilterProgress

void Isis::TableViewHeader::updateFilterProgress ( int  newProgress)
slot

Updates the current filter progress value.

Parameters
newProgressNew progress value

Definition at line 622 of file TableViewHeader.cpp.

Referenced by setModel().

◆ updateFilterProgressRange

void Isis::TableViewHeader::updateFilterProgressRange ( int  min,
int  max 
)
slot

Updates the range of the filter progress.

Parameters
minThe minimum progress
maxThe maximum progress

Definition at line 634 of file TableViewHeader.cpp.

Referenced by setModel().

◆ updateHeaderOffset

void Isis::TableViewHeader::updateHeaderOffset ( int  newOffset)
slot

Updates the header offset.

Parameters
newOffsetThe new header offset

Definition at line 197 of file TableViewHeader.cpp.

◆ updateRebuildProgress

void Isis::TableViewHeader::updateRebuildProgress ( int  newProgress)
slot

Updates the current rebuild progress value.

Parameters
newProgressNew progress value

Definition at line 646 of file TableViewHeader.cpp.

Referenced by setModel().

◆ updateRebuildProgressRange

void Isis::TableViewHeader::updateRebuildProgressRange ( int  min,
int  max 
)
slot

Updates the range of the rebuild progress.

Parameters
minThe minimum progress
maxThe maximum progress

Definition at line 658 of file TableViewHeader.cpp.

Referenced by setModel().

◆ updateSortProgress

void Isis::TableViewHeader::updateSortProgress ( int  newProgress)
slot

Updates the current sort progress value.

Parameters
newProgressNew progress value

Definition at line 670 of file TableViewHeader.cpp.

Referenced by setModel().

◆ updateSortProgressRange

void Isis::TableViewHeader::updateSortProgressRange ( int  min,
int  max 
)
slot

Updates the range of the sort progress.

Parameters
minThe minimum progress
maxThe maximum progress

Definition at line 682 of file TableViewHeader.cpp.

Referenced by setModel().


The documentation for this class was generated from the following files: