VTK  9.1.0
Public Types | Signals | Public Member Functions | List of all members
vtkQtTableModelAdapter Class Reference

Adapts a table to a Qt item model. More...

#include <vtkQtTableModelAdapter.h>

Inheritance diagram for vtkQtTableModelAdapter:
[legend]
Collaboration diagram for vtkQtTableModelAdapter:
[legend]

Public Types

enum  { HEADER = 0 , ITEM = 1 }
 
enum  { COLORS = 0 , ICONS = 1 , NONE = 2 }
 
- Public Types inherited from vtkQtAbstractModelAdapter
enum  { FULL_VIEW , DATA_VIEW }
 

Signals

void selectionDropped (vtkSelection *)
 
- Signals inherited from vtkQtAbstractModelAdapter
void modelChanged ()
 

Public Member Functions

 vtkQtTableModelAdapter (QObject *parent=nullptr)
 
 vtkQtTableModelAdapter (vtkTable *table, QObject *parent=nullptr)
 
 ~vtkQtTableModelAdapter () override
 
void SetKeyColumnName (const char *name) override
 
void SetColorColumnName (const char *name) override
 
void SetIconIndexColumnName (const char *name)
 
void SetDecorationLocation (int s)
 Specify how to color rows if colors are provided by SetColorColumnName(). More...
 
void SetDecorationStrategy (int s)
 Specify how to color rows if colors are provided by SetColorColumnName(). More...
 
bool GetSplitMultiComponentColumns () const
 
void SetSplitMultiComponentColumns (bool value)
 
bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
 
QMimeData * mimeData (const QModelIndexList &indexes) const override
 
QStringList mimeTypes () const override
 
Qt::DropActions supportedDropActions () const override
 
void SetIconSheet (QImage sheet)
 
void SetIconSize (int w, int h)
 
void SetIconSheetSize (int w, int h)
 
void SetVTKDataObject (vtkDataObject *data) override
 Set/Get the VTK data object as input to this adapter. More...
 
vtkDataObjectGetVTKDataObject () const override
 Set/Get the VTK data object as input to this adapter. More...
 
vtkSelectionQModelIndexListToVTKIndexSelection (const QModelIndexList qmil) const override
 Selection conversion from VTK land to Qt land. More...
 
QItemSelection VTKIndexSelectionToQItemSelection (vtkSelection *vtksel) const override
 Selection conversion from VTK land to Qt land. More...
 
void setTable (vtkTable *table)
 Set up the model based on the current table. More...
 
vtkTabletable () const
 Set up the model based on the current table. More...
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 Set up the model based on the current table. More...
 
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
 Set up the model based on the current table. More...
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 Set up the model based on the current table. More...
 
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
 Set up the model based on the current table. More...
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 Set up the model based on the current table. More...
 
QModelIndex parent (const QModelIndex &index) const override
 Set up the model based on the current table. More...
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 Set up the model based on the current table. More...
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 Set up the model based on the current table. More...
 
- Public Member Functions inherited from vtkQtAbstractModelAdapter
 vtkQtAbstractModelAdapter (QObject *p)
 
virtual void SetViewType (int type)
 Set/Get the view type. More...
 
virtual int GetViewType ()
 
virtual void SetKeyColumn (int col)
 Set/Get the key column. More...
 
virtual int GetKeyColumn ()
 
virtual void SetKeyColumnName (const char *name)=0
 
virtual void SetColorColumn (int col)
 Set/Get the column storing the rgba color values for each row. More...
 
virtual int GetColorColumn ()
 
virtual void SetColorColumnName (const char *name)=0
 
virtual void SetDataColumnRange (int c1, int c2)
 Set the range of columns that specify the main data matrix. More...
 
void reset ()
 
void beginResetModel ()
 
void endResetModel ()
 

Additional Inherited Members

- Protected Member Functions inherited from vtkQtAbstractModelAdapter
virtual int ModelColumnToFieldDataColumn (int col) const
 Map a column index in the QAbstractItemModel to a vtkTable column. More...
 
- Protected Attributes inherited from vtkQtAbstractModelAdapter
int ViewType
 
int KeyColumn
 
int ColorColumn
 
int DataStartColumn
 
int DataEndColumn
 

Detailed Description

Adapts a table to a Qt item model.

vtkQtTableModelAdapter is a QAbstractItemModel with a vtkTable as its underlying data model.

See also
vtkQtAbstractModelAdapter vtkQtTreeModelAdapter

Definition at line 45 of file vtkQtTableModelAdapter.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
HEADER 
ITEM 

Definition at line 74 of file vtkQtTableModelAdapter.h.

◆ anonymous enum

anonymous enum
Enumerator
COLORS 
ICONS 
NONE 

Definition at line 80 of file vtkQtTableModelAdapter.h.

Constructor & Destructor Documentation

◆ vtkQtTableModelAdapter() [1/2]

vtkQtTableModelAdapter::vtkQtTableModelAdapter ( QObject *  parent = nullptr)

◆ vtkQtTableModelAdapter() [2/2]

vtkQtTableModelAdapter::vtkQtTableModelAdapter ( vtkTable table,
QObject *  parent = nullptr 
)

◆ ~vtkQtTableModelAdapter()

vtkQtTableModelAdapter::~vtkQtTableModelAdapter ( )
override

Member Function Documentation

◆ SetVTKDataObject()

void vtkQtTableModelAdapter::SetVTKDataObject ( vtkDataObject data)
overridevirtual

Set/Get the VTK data object as input to this adapter.

Implements vtkQtAbstractModelAdapter.

◆ GetVTKDataObject()

vtkDataObject * vtkQtTableModelAdapter::GetVTKDataObject ( ) const
overridevirtual

Set/Get the VTK data object as input to this adapter.

Implements vtkQtAbstractModelAdapter.

◆ QModelIndexListToVTKIndexSelection()

vtkSelection * vtkQtTableModelAdapter::QModelIndexListToVTKIndexSelection ( const QModelIndexList  qmil) const
overridevirtual

Selection conversion from VTK land to Qt land.

Implements vtkQtAbstractModelAdapter.

◆ VTKIndexSelectionToQItemSelection()

QItemSelection vtkQtTableModelAdapter::VTKIndexSelectionToQItemSelection ( vtkSelection vtksel) const
overridevirtual

Selection conversion from VTK land to Qt land.

Implements vtkQtAbstractModelAdapter.

◆ SetKeyColumnName()

void vtkQtTableModelAdapter::SetKeyColumnName ( const char *  name)
overridevirtual

◆ SetColorColumnName()

void vtkQtTableModelAdapter::SetColorColumnName ( const char *  name)
overridevirtual

◆ SetIconIndexColumnName()

void vtkQtTableModelAdapter::SetIconIndexColumnName ( const char *  name)

◆ SetDecorationLocation()

void vtkQtTableModelAdapter::SetDecorationLocation ( int  s)

Specify how to color rows if colors are provided by SetColorColumnName().

Default is the vertical header.

◆ SetDecorationStrategy()

void vtkQtTableModelAdapter::SetDecorationStrategy ( int  s)

Specify how to color rows if colors are provided by SetColorColumnName().

Default is the vertical header.

◆ GetSplitMultiComponentColumns()

bool vtkQtTableModelAdapter::GetSplitMultiComponentColumns ( ) const

◆ SetSplitMultiComponentColumns()

void vtkQtTableModelAdapter::SetSplitMultiComponentColumns ( bool  value)

◆ setTable()

void vtkQtTableModelAdapter::setTable ( vtkTable table)

Set up the model based on the current table.

◆ table()

vtkTable * vtkQtTableModelAdapter::table ( ) const
inline

Set up the model based on the current table.

Definition at line 107 of file vtkQtTableModelAdapter.h.

◆ data()

QVariant vtkQtTableModelAdapter::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
override

Set up the model based on the current table.

◆ setData()

bool vtkQtTableModelAdapter::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)
override

Set up the model based on the current table.

◆ flags()

Qt::ItemFlags vtkQtTableModelAdapter::flags ( const QModelIndex &  index) const
override

Set up the model based on the current table.

◆ headerData()

QVariant vtkQtTableModelAdapter::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const
override

Set up the model based on the current table.

◆ index()

QModelIndex vtkQtTableModelAdapter::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const
override

Set up the model based on the current table.

◆ parent()

QModelIndex vtkQtTableModelAdapter::parent ( const QModelIndex &  index) const
override

Set up the model based on the current table.

◆ rowCount()

int vtkQtTableModelAdapter::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

Set up the model based on the current table.

◆ columnCount()

int vtkQtTableModelAdapter::columnCount ( const QModelIndex &  parent = QModelIndex()) const
override

Set up the model based on the current table.

◆ dropMimeData()

bool vtkQtTableModelAdapter::dropMimeData ( const QMimeData *  data,
Qt::DropAction  action,
int  row,
int  column,
const QModelIndex &  parent 
)
override

◆ mimeData()

QMimeData * vtkQtTableModelAdapter::mimeData ( const QModelIndexList &  indexes) const
override

◆ mimeTypes()

QStringList vtkQtTableModelAdapter::mimeTypes ( ) const
override

◆ supportedDropActions()

Qt::DropActions vtkQtTableModelAdapter::supportedDropActions ( ) const
override

◆ SetIconSheet()

void vtkQtTableModelAdapter::SetIconSheet ( QImage  sheet)

◆ SetIconSize()

void vtkQtTableModelAdapter::SetIconSize ( int  w,
int  h 
)

◆ SetIconSheetSize()

void vtkQtTableModelAdapter::SetIconSheetSize ( int  w,
int  h 
)

◆ selectionDropped

void vtkQtTableModelAdapter::selectionDropped ( vtkSelection )
signal

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