The RegistrationModel class is a custom model that extends QStandardItemModel.
More...
#include <registrationmodel.h>
|
| void | dataUpdated (const QModelIndex &index) |
| | Signal emitted when the data in the model is updated.
|
| |
|
| | RegistrationModel (QObject *parent=nullptr) |
| | Constructs a RegistrationModel object.
|
| |
| bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override |
| | Sets the data for the specified index in the model.
|
| |
| void | sort (int column, Qt::SortOrder order=Qt::AscendingOrder) override |
| | Sorts the model based on the specified column and order.
|
| |
| void | addItem (Registration *registration) |
| | Adds a Registration object to the model.
|
| |
| void | removeRegistration (int row) |
| | Removes the Registration at the specified row from the model.
|
| |
|
void | clear () |
| | Clears the model, removing all Registrations.
|
| |
The RegistrationModel class is a custom model that extends QStandardItemModel.
This class provides additional functionality for managing Registration objects in a model. It allows adding, removing, and sorting registrations, as well as updating the data in the model.
◆ RegistrationModel()
| RegistrationModel::RegistrationModel |
( |
QObject * | parent = nullptr | ) |
|
|
explicit |
◆ addItem()
| void RegistrationModel::addItem |
( |
Registration * | registration | ) |
|
◆ dataUpdated
| void RegistrationModel::dataUpdated |
( |
const QModelIndex & | index | ) |
|
|
signal |
Signal emitted when the data in the model is updated.
- Parameters
-
| index | The index of the updated data. |
◆ removeRegistration()
| void RegistrationModel::removeRegistration |
( |
int | row | ) |
|
Removes the Registration at the specified row from the model.
- Parameters
-
◆ setData()
| bool RegistrationModel::setData |
( |
const QModelIndex & | index, |
|
|
const QVariant & | value, |
|
|
int | role = Qt::EditRole ) |
|
override |
Sets the data for the specified index in the model.
- Parameters
-
| index | The index of the item to set the data for. |
| value | The new value for the item. |
| role | The role for which the data is being set (default is Qt::EditRole). |
- Returns
- true if the data was successfully set, false otherwise.
◆ sort()
| void RegistrationModel::sort |
( |
int | column, |
|
|
Qt::SortOrder | order = Qt::AscendingOrder ) |
|
override |
Sorts the model based on the specified column and order.
- Parameters
-
| column | The column to sort by. |
| order | The sort order (default is Qt::AscendingOrder). |
The documentation for this class was generated from the following files: