GridModelController Class
GridModelController class processes the tabular data from Qt models and provides them in a convenient way to display in the view. Inside of it are performed grouping and sorting operations, focus handling, column's data binding and other important data-related operations. More...
Header: | #include <GridModelController> |
Inherits: | QObject |
Public Types
flags | Changes |
Public Functions
Qtitan::ItemPosition | defaultPinnedPosition() const |
Qtitan::EditStrategy | editStrategy() const |
Qtitan::ItemPosition | indexPinnedPosition(const QModelIndex &index) const |
void | setEditStrategy(Qtitan::EditStrategy strategy) |
void | setIndexPinnedPosition(const QModelIndex &index, Qtitan::ItemPosition position) |
Related Non-Members
enum | EditStrategy { OnFieldChange, OnRowChange } |
enum | SortOrder { SortNone, SortAscending, SortDescending } |
Detailed Description
Member Function Documentation
Qtitan::ItemPosition GridModelController::defaultPinnedPosition() const
Returns the default frozen place for pinned rows. Enumirator Qtitan::ItemPosition describes the place where the rows will be pinned by default. Qtitan::AtBeginning - Row frozen at the begining of the view and can't be vertical scrolled (always displayed on view). Qtitan::AtEnd - Row frozen at the bottom of the view and can't be vertical scrolled (always displayed on view).
Qtitan::EditStrategy GridModelController::editStrategy() const
Returns the strategy for data submiting to the model after the cell's value has changed.
See also setEditStrategy().
Qtitan::ItemPosition GridModelController::indexPinnedPosition(const QModelIndex &index) const
Returns Qtitan::AtBeginning or Qtitan::AtEnd if the row related to index is fixed at the view on the top or bottom position. If the index is not fixed, then it returns Qtitan::AtNone.
See also setIndexPinnedPosition().
void GridModelController::setEditStrategy(Qtitan::EditStrategy strategy)
Sets the strategy for data submiting to the model after the cell's value has changed. Please note what the setting does not has effect if QSqlTableModel is used with edit strategy equal to QSqlTableModel::OnFieldChange.
See also editStrategy().
void GridModelController::setIndexPinnedPosition(const QModelIndex &index, Qtitan::ItemPosition position)
Fixes the row related to the model index to the position at the view.
See also indexPinnedPosition().
Related Non-Members
enum EditStrategy
Enumerator EditStrategy describes the behaviour how the data should be submitted to the model.
Constant | Value | Description |
---|---|---|
GridModelController::OnFieldChange | 0 | Data will be submited to the model immediately once the value has changed. |
GridModelController::OnRowChange | 1 | Data will be submited to the model if row focus has changed. |
enum SortOrder
This enum describes sort order for column.
Constant | Value | Description |
---|---|---|
GridModelController::SortNone | 0 | No sorting |
GridModelController::SortAscending | 1 | Low to high sorting |
GridModelController::SortDescending | 2 | High to low sorting |