GridRow Class

GridRow class introduce a row to display in a grid view. The row can be of two types - data row and a row that represents the group - group row. See GridRow::type() for more details. Number of rows does not always match the number of rows that are available in the Qt model. For example, if the filter has been imposed or grid has grouping then the number of grid rows will be different than Qt model rows. More...

Header: #include <GridRow>

Public Types

enum Type { DataRow, GroupRow }

Public Functions

GridCell cell(int index) const
GridModelController *controller() const
int depth() const
int groupColumn() const
bool isGroupExpanded() const
bool isPinned() const
QModelIndex modelIndex(int column = 0) const
int rowIndex() const
bool setGroupExpanded(bool expanded)
void setPinned(bool pinned)
GridRow::Type type() const

Detailed Description

Member Type Documentation

enum GridRow::Type

Enumirator RowType describes the type of the grid row. At the moment there are two types of rows - Data row, related to the model data and Group row, related to the group of data rows after grouping.

ConstantValueDescription
GridRow::DataRow0Data row
GridRow::GroupRow1Group row

Member Function Documentation

GridCell GridRow::cell(int index) const

Creates and returns GridCell structure for current row and cell index.

GridModelController *GridRow::controller() const

Returns the controller owner for this row.

int GridRow::depth() const

Returns depth for GroupRow. For DataRow this function does not has effect and always returns -1.

int GridRow::groupColumn() const

If the row is a GroupRow returns model column index by which the group is formed. If row is a DataRow the result is -1.

bool GridRow::isGroupExpanded() const

Returns expanded state for row if row is a GroupRow. For DataRow this function does not has effect and always returns true.

bool GridRow::isPinned() const

Returns the pinned state for the row.

QModelIndex GridRow::modelIndex(int column = 0) const

contstructs QModelIndex index related to the grid row.

int GridRow::rowIndex() const

Returns index number for row.

bool GridRow::setGroupExpanded(bool expanded)

Expands or collapses the row if row is a GroupRow. For DataRow functions does nothing.

See also isGroupExpanded().

void GridRow::setPinned(bool pinned)

Sets the pinned state for the row. if the value is true then the row will be freeze at the GridModelController::defaultFrozenPlace() place. Please note, function does not has effect if GridRow::type() is not equal a GridRow::DataRow.

See also isPinned().

GridRow::Type GridRow::type() const

Returns the type of the row. It can be DataRow or GroupRow.