Initial commit
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user