Conference Registration 2024.07.18.04
Loading...
Searching...
No Matches
registrationmodel.h
Go to the documentation of this file.
1
9#ifndef REGISTRATIONMODEL_H
10#define REGISTRATIONMODEL_H
11
12#include <QStandardItemModel>
13
14class Registration;
15
16
22class RegistrationModel : public QStandardItemModel
23{
24 Q_OBJECT
25public:
30 explicit RegistrationModel(QObject *parent = nullptr);
31
39 bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
40
46 void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
47
52 void addItem(Registration *registration);
53
58 void removeRegistration(int row);
59
63 void clear();
64
65signals:
70 void dataUpdated(const QModelIndex &index);
71
72private:
76 void setHeaders();
77
81 void initializeModel();
82};
83
84#endif // REGISTRATIONMODEL_H
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.