Workspace 6.21.5
Public Member Functions | List of all members
MatrixTableDelegate< T, R, W, S > Class Template Reference

Delegate class that knows how to display matrix information (of type T) in a QTable. More...

#include <Workspace/Widgets/matrixwidget.h>

Inheritance diagram for MatrixTableDelegate< T, R, W, S >:
[legend]

Public Member Functions

 MatrixTableDelegate (const R &reader=R(), const W &writer=W(), const S &size=S())
 
getMatrixImpl () const
 
int getNumCols () const override
 
int getNumRows () const override
 
void updateTableImpl (const T &matrix)
 
- Public Member Functions inherited from MatrixTableDelegateBase
virtual ~MatrixTableDelegateBase ()=default
 
void createTable (QWidget *parent)
 
template<typename T >
getMatrix () const
 
virtual int getNumCols () const =0
 
virtual int getNumRows () const =0
 
template<typename T >
void updateTable (const T &matrix)
 

Additional Inherited Members

- Protected Member Functions inherited from MatrixTableDelegateBase
 MatrixTableDelegateBase ()
 
- Protected Attributes inherited from MatrixTableDelegateBase
QTableWidget * table_
 

Detailed Description

template<typename T, typename R, typename W, typename S>
class CSIRO::Widgets::MatrixTableDelegate< T, R, W, S >
Template Parameters
TThe type of matrix we are going to display in a table.
RThe reader policy: a class that knows how to read cells from matrices of type T.
WThe writer policy: a class that knows how to write to the cells of matrices of type T.
SThe size policy: a class that knows how to find out how many rows or columns are in matrices of type T.
Note
Template parameters R, W and S are defaulted so that they operate with matrices that use operator(i,j) to access cells, and have a fixed row / column size.

Constructor & Destructor Documentation

◆ MatrixTableDelegate()

MatrixTableDelegate ( const R &  reader = R(),
const W &  writer = W(),
const S &  size = S() 
)
inline
Parameters
readerThe reader to use to extract cell values from matrices.
writerThe writer to use to set cell values in a matrix.
sizeThe size object to use to get the row / column sizes from a matrix.

Member Function Documentation

◆ getMatrixImpl()

T getMatrixImpl ( ) const
inline
Returns
A matrix of type T that contains the values specified in the QTable.

◆ getNumCols()

int getNumCols ( ) const
inlineoverridevirtual
Returns
The number of columns in the matrix / table.

Implements MatrixTableDelegateBase.

◆ getNumRows()

int getNumRows ( ) const
inlineoverridevirtual
Returns
The number of rows in the matrix / table.

Implements MatrixTableDelegateBase.

◆ updateTableImpl()

void updateTableImpl ( const T &  matrix)
inline
Parameters
matrixThe matrix we are going to use to set the table cells.

Updates the QTable to contain the values held within matrix.