Conference Registration 2024.07.18.04
Loading...
Searching...
No Matches
RegistrationModel Class Reference

The RegistrationModel class is a custom model that extends QStandardItemModel. More...

#include <registrationmodel.h>

Inheritance diagram for RegistrationModel:

Signals

void dataUpdated (const QModelIndex &index)
 Signal emitted when the data in the model is updated.
 

Public Member Functions

 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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ RegistrationModel()

RegistrationModel::RegistrationModel ( QObject * parent = nullptr)
explicit

Constructs a RegistrationModel object.

Parameters
parentThe parent object.

Member Function Documentation

◆ addItem()

void RegistrationModel::addItem ( Registration * registration)

Adds a Registration object to the model.

Parameters
registrationThe Registration object to add.

◆ dataUpdated

void RegistrationModel::dataUpdated ( const QModelIndex & index)
signal

Signal emitted when the data in the model is updated.

Parameters
indexThe index of the updated data.

◆ removeRegistration()

void RegistrationModel::removeRegistration ( int row)

Removes the Registration at the specified row from the model.

Parameters
rowThe row of the Registration to remove.

◆ 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
indexThe index of the item to set the data for.
valueThe new value for the item.
roleThe 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
columnThe column to sort by.
orderThe sort order (default is Qt::AscendingOrder).

The documentation for this class was generated from the following files: