#include <pqSpreadSheetViewModel.h>
Inherits QAbstractTableModel.
Classes | |
| class | vtkIndex |
Public Types | |
| enum | { SectionInternal = Qt::UserRole + 1, SectionVisible, SectionHeaderTemp } |
Public Slots | |
| void | forceUpdate () |
| resets the model. More... | |
| void | setActiveRepresentation (pqDataRepresentation *) |
| Sets the active representation. More... | |
| void | setActiveRepresentationProxy (vtkSMProxy *) |
| Sets the active representation. More... | |
Signals | |
| void | selectionChanged (const QItemSelection &selection) |
| Fired whenever the server side selection changes. More... | |
Public Member Functions | |
| pqSpreadSheetViewModel (vtkSMProxy *viewProxy, QObject *parent=nullptr) | |
| ~pqSpreadSheetViewModel () override | |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| Returns the number of rows. More... | |
| int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
| Returns the number of columns. More... | |
| QVariant | data (const QModelIndex &index, int role=Qt::DisplayRole) const override |
| Returns the data storeed under the given role for the item referred by the index. More... | |
| QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
| Returns the data for the given role and section in the header with the specified orientation. More... | |
| bool | setHeaderData (int section, Qt::Orientation orientation, const QVariant &value, int role) override |
| Allow to hide header label data using the SectionHeaderTemp role note: all other calls are passed to the parent class. More... | |
| void | sortSection (int section, Qt::SortOrder order) |
| Make a server request to sort based on a given column with a given order. More... | |
| bool | isSortable (int section) |
| Return true only if the given column is sortable. More... | |
| int | getFieldType () const |
| Returns the field type for the data currently shown by this model. More... | |
| QSet< vtkIndex > | getVTKIndices (const QModelIndexList &indexes) |
| void | setDecimalPrecision (int) |
| Set/Get the decimal precision for float and double type data. More... | |
| int | getDecimalPrecision () |
| void | setFixedRepresentation (bool) |
| Set/Get whether the decimal representation is fixed or scientific. More... | |
| bool | getFixedRepresentation () |
| void | setActiveRegion (int row_top, int row_bottom) |
| set the region (in row indices) that is currently being shown in the view. More... | |
| pqDataRepresentation * | activeRepresentation () const |
| Returns the active representation. More... | |
| vtkSMProxy * | activeRepresentationProxy () const |
| Qt::ItemFlags | flags (const QModelIndex &index) const override |
| Method needed for copy/past cell editor. More... | |
| bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override |
| QString | GetRowsAsString () const |
| Returns the current rows as a CSV-formatted string, including header with column names. More... | |
Protected Member Functions | |
| bool | isDataValid (const QModelIndex &idx) const |
| Given an index into the model, check to see that its row number is less than the length of the data array associated with its column. More... | |
| vtkSpreadSheetView * | GetView () const |
Definition at line 29 of file pqSpreadSheetViewModel.h.
| anonymous enum |
| Enumerator | |
|---|---|
| SectionInternal | |
| SectionVisible | |
| SectionHeaderTemp | |
Definition at line 132 of file pqSpreadSheetViewModel.h.
| pqSpreadSheetViewModel::pqSpreadSheetViewModel | ( | vtkSMProxy * | viewProxy, |
| QObject * | parent = nullptr |
||
| ) |
|
override |
Returns the number of rows.
|
override |
Returns the number of columns.
|
override |
Returns the data storeed under the given role for the item referred by the index.
|
override |
Returns the data for the given role and section in the header with the specified orientation.
When orientation is Qt::Horizontal, pqSpreadSheetViewModel adds support for two new roles: pqSpreadSheetViewModel::SectionVisible, and pqSpreadSheetViewModel::SectionInternal. SectionVisible can be used to determine if the column (or horizontal section) is visible or hidden. SectionInternal is used to determine if the section is internal. An internal section is also hidden. When data associated with these two roles changes, the model will fire headerDataChanged signal.
|
override |
Allow to hide header label data using the SectionHeaderTemp role note: all other calls are passed to the parent class.
| void pqSpreadSheetViewModel::sortSection | ( | int | section, |
| Qt::SortOrder | order | ||
| ) |
Make a server request to sort based on a given column with a given order.
| bool pqSpreadSheetViewModel::isSortable | ( | int | section | ) |
Return true only if the given column is sortable.
| int pqSpreadSheetViewModel::getFieldType | ( | ) | const |
Returns the field type for the data currently shown by this model.
| void pqSpreadSheetViewModel::setDecimalPrecision | ( | int | ) |
Set/Get the decimal precision for float and double type data.
| int pqSpreadSheetViewModel::getDecimalPrecision | ( | ) |
| void pqSpreadSheetViewModel::setFixedRepresentation | ( | bool | ) |
Set/Get whether the decimal representation is fixed or scientific.
True is fixed and False is scientific
| bool pqSpreadSheetViewModel::getFixedRepresentation | ( | ) |
set the region (in row indices) that is currently being shown in the view.
the model will provide data-values only for the active-region. For any other region it will simply return a "..." text for display (in QAbstractTableModel::data(..) callback).
| pqDataRepresentation* pqSpreadSheetViewModel::activeRepresentation | ( | ) | const |
Returns the active representation.
Active representation is the representation being shown by the view.
| vtkSMProxy* pqSpreadSheetViewModel::activeRepresentationProxy | ( | ) | const |
|
override |
Method needed for copy/past cell editor.
|
override |
| QString pqSpreadSheetViewModel::GetRowsAsString | ( | ) | const |
Returns the current rows as a CSV-formatted string, including header with column names.
Uses the vtkCSVExporter.
|
slot |
resets the model.
|
slot |
Sets the active representation.
Active representation is the representation being shown by the view.
|
slot |
Sets the active representation.
When using this API instead of setActiveRepresentation(pqDataRepresentation*), some functionality won't be available.
|
signal |
Fired whenever the server side selection changes.
|
protected |
Given an index into the model, check to see that its row number is less than the length of the data array associated with its column.
|
protected |
1.8.13 on Mon Oct 12 2026