1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
|
/*
Copyright (c) 2006-2009, Tom Thielicke IT Solutions
SPDX-License-Identifier: GPL-2.0-only
*/
/****************************************************************
**
** Definition of the LessonTableSql class
** File name: lessontablesql.h
**
****************************************************************/
#include <QChar>
#include <QComboBox>
#include <QHeaderView>
#include <QLabel>
#include <QList>
#include <QModelIndex>
#include <QPushButton>
#include <QSqlQuery>
#include <QSqlQueryModel>
#include <QTableView>
#include <QVariant>
#include <QWidget>
#ifndef LESSONSQLMODEL_H
#define LESSONSQLMODEL_H
//! The LessonSqlModel class provides a table model to format cells.
/*!
@author Tom Thielicke, s712715
@version 0.0.7
@date 21.06.2006
*/
class LessonSqlModel : public QSqlQueryModel {
Q_OBJECT
public:
LessonSqlModel(int row, int type, QWidget* parent = 0);
int lastIdInserted;
private:
int lastTypeInserted;
QVariant data(const QModelIndex& index, int role) const;
QWidget* parentWidget;
QString language;
};
#endif // LESSONSQLMODEL_H
#ifndef LESSONTABLESQL_H
#define LESSONTABLESQL_H
//! The LessonTableSql class provides a table widget with lessons.
/*!
@author Tom Thielicke, s712715
@version 0.0.2
@date 16.06.2006
*/
class LessonTableSql : public QWidget {
Q_OBJECT
public:
LessonTableSql(int row, int type, QWidget* parent = 0);
private slots:
void sortColumn(int columnindex);
void changeFilter(int rowindex);
private:
void setModelHeader();
QLabel* labelFilter;
QComboBox* comboFilter;
LessonSqlModel* model;
QTableView* view;
QHeaderView* headerview;
QVariant data(const QModelIndex& item, int role) const;
void setQueryOrder(QString columnname, bool isdesc);
int previousColumnIndex;
QString columnName;
QString whereClausel;
bool isDesc;
};
#endif // LESSONTABLESQL_H
|