36 lines
774 B
C++
36 lines
774 B
C++
|
|
#ifndef TICKETS_MODEL_H
|
||
|
|
#define TICKETS_MODEL_H
|
||
|
|
|
||
|
|
#include "base_sql_table_model.h"
|
||
|
|
|
||
|
|
class TicketsModel : public BaseSqlTableModel {
|
||
|
|
Q_OBJECT
|
||
|
|
|
||
|
|
public:
|
||
|
|
enum TicketsColumns { Id, SessionId, SeatNumber, SoldAt };
|
||
|
|
|
||
|
|
public:
|
||
|
|
explicit TicketsModel(QObject *parent, const QSqlDatabase &database);
|
||
|
|
|
||
|
|
// Initialize the model
|
||
|
|
void initialize();
|
||
|
|
|
||
|
|
// Overlooking class BaseSqlTableModel methods
|
||
|
|
|
||
|
|
QVariant headerData(int section, Qt::Orientation orientation,
|
||
|
|
int role = Qt::DisplayRole) const override;
|
||
|
|
|
||
|
|
inline bool isCompleteDatabaseFiltering() const final {
|
||
|
|
#ifdef NO_DATE_TIME_SEARCH
|
||
|
|
return false;
|
||
|
|
#else
|
||
|
|
return true;
|
||
|
|
#endif
|
||
|
|
};
|
||
|
|
|
||
|
|
protected:
|
||
|
|
QString createMultiColumnFilter(const QString &filter) const final;
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif // TICKETS_MODEL_H
|