Workspace 6.21.5
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MatrixTableDelegateBase Class Referenceabstract

Base class for all matrix table delegates. A matrix table delegate knows how to display a matrix of a certain data type in a QTable. More...

#include <Workspace/Widgets/matrixwidget.h>

Inheritance diagram for MatrixTableDelegateBase:
[legend]

Public Member Functions

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)
 

Protected Member Functions

 MatrixTableDelegateBase ()
 

Protected Attributes

QTableWidget * table_
 

Detailed Description

The MatrixTableDelegateBase and MatrixTableDelegate classes allow us to get around restrictions in the MOC compiler - we cannot have a template widget. Instead of a template widget, we have created delegate objects which know how to display our template objects in a table.

The template class MatrixTableDelegate provides default template arguments for the read / write / size policies for accessing a specific data structure (see the forward declaration above).

Constructor & Destructor Documentation

◆ MatrixTableDelegateBase()

MatrixTableDelegateBase ( )
inlineprotected

◆ ~MatrixTableDelegateBase()

virtual ~MatrixTableDelegateBase ( )
virtualdefault

Member Function Documentation

◆ createTable()

void createTable ( QWidget *  parent)
inline
Parameters
parentThe parent widget of the table.

Creates the QTable object of the correct size and parents it to the specified widget.

◆ getMatrix()

T getMatrix ( ) const
inline

◆ getNumCols()

virtual int getNumCols ( ) const
pure virtual

◆ getNumRows()

virtual int getNumRows ( ) const
pure virtual

◆ updateTable()

void updateTable ( const T &  matrix)
inline

Member Data Documentation

◆ table_

QTableWidget* table_
protected