20#ifndef QVTKTableModelAdapter_h
21#define QVTKTableModelAdapter_h
23#include "vtkGUISupportQtModule.h"
25#include <QAbstractItemModel>
32VTK_ABI_NAMESPACE_BEGIN
84 virtual void SetCellValue(
int row,
int column,
const QVariant& data);
90 virtual void UpdateTable(
int row0,
int column0,
int row1,
int column1);
99 const QModelIndex& topLeft,
const QModelIndex& bottomRight,
const QVector<int>& roles);
102 const QList<QPersistentModelIndex>& parents, QAbstractItemModel::LayoutChangeHint hint);
106 const QModelIndex& parent,
int start,
int end,
const QModelIndex& destination,
int row);
110 const QModelIndex& parent,
int start,
int end,
const QModelIndex& destination,
int column);
An adapter to create a vtkTable from an QAbstractItemModel.
virtual void onColumnsInserted(const QModelIndex &parent, int first, int last)
void tableChanged()
Signal emitted when the internal vtkTable has changed.
QVTKTableModelAdapter(QObject *parent=nullptr)
virtual void onColumnsMoved(const QModelIndex &parent, int start, int end, const QModelIndex &destination, int column)
virtual void SetCellValue(int row, int column, const QVariant &data)
Sets the value of the cell given by row, column using the adequate QVariant type conversion.
virtual void onColumnsRemoved(const QModelIndex &parent, int first, int last)
virtual void onHeaderDataChanged(Qt::Orientation orientation, int first, int last)
QAbstractItemModel * GetItemModel() const
Get/set the Qt table model.
virtual void onModelReset()
virtual void UpdateTable(int row0, int column0, int row1, int column1)
Update the internal table from row0 to inclusive row1, and from column0 to inclusive column1 so it re...
virtual void SetItemModel(QAbstractItemModel *model)
Get/set the Qt table model.
virtual QVariant modelData(int row, int col)
The default method for retrieving data for a table entry from the item model.
virtual void onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles)
QVTKTableModelAdapter(QAbstractItemModel *model, QObject *parent=nullptr)
virtual void onRowsRemoved(const QModelIndex &parent, int first, int last)
vtkTable * GetTable() const
Access to the vtkTable.
virtual bool HasCorrectColumnArrays()
Check that the correct array types are set for the columns.
virtual void onRowsInserted(const QModelIndex &parent, int first, int last)
virtual void onLayoutChanged(const QList< QPersistentModelIndex > &parents, QAbstractItemModel::LayoutChangeHint hint)
virtual void onModified()
virtual void onRowsMoved(const QModelIndex &parent, int start, int end, const QModelIndex &destination, int row)
virtual vtkAbstractArray * NewArray(const QVariant &type)
Return a suitable vtk array for the QVariant type.
QPointer< QAbstractItemModel > ItemModel
Abstract superclass for all arrays.
Allocate and hold a VTK object.
A table, which contains similar-typed columns of data.