9#ifndef REGISTRATIONMODEL_H
10#define REGISTRATIONMODEL_H
12#include <QStandardItemModel>
39 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole)
override;
46 void sort(
int column, Qt::SortOrder order = Qt::AscendingOrder)
override;
81 void initializeModel();
The Registration class represents a registration for an event.
Definition registration.h:24
The RegistrationModel class is a custom model that extends QStandardItemModel.
Definition registrationmodel.h:23
void removeRegistration(int row)
Removes the Registration at the specified row from the model.
Definition registrationmodel.cpp:91
RegistrationModel(QObject *parent=nullptr)
Constructs a RegistrationModel object.
Definition registrationmodel.cpp:30
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override
Sets the data for the specified index in the model.
Definition registrationmodel.cpp:37
void addItem(Registration *registration)
Adds a Registration object to the model.
Definition registrationmodel.cpp:58
void clear()
Clears the model, removing all Registrations.
Definition registrationmodel.cpp:97
void sort(int column, Qt::SortOrder order=Qt::AscendingOrder) override
Sorts the model based on the specified column and order.
Definition registrationmodel.cpp:45
void dataUpdated(const QModelIndex &index)
Signal emitted when the data in the model is updated.