1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00
LibQQt/qqttablemodel.h
tianduanrui 3f857669fc init
2016-12-29 16:49:18 +08:00

33 lines
865 B
C++
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef QQTTABLEMODEL_H
#define QQTTABLEMODEL_H
#include <QSqlRelationalTableModel>
/**
* @brief The QQTTableModel class
* QQTSqlRelationalTableModel 方便起见仅仅使用这个model
*/
class QQTTableModel : public QSqlRelationalTableModel
{
Q_OBJECT
public:
explicit QQTTableModel(QObject *parent = 0, QSqlDatabase db = QSqlDatabase());
void query(QString filter);
public:
QVariant data(const QModelIndex &item, int role = Qt::DisplayRole) const;
bool setData(const QModelIndex &item, const QVariant &value, int role = Qt::EditRole);
Qt::ItemFlags flags(const QModelIndex &index) const;
signals:
public slots:
private:
QMap<QModelIndex, QString> idata;
QMap<QModelIndex, Qt::ItemFlag> iflag;
QMap<QModelIndex, Qt::AlignmentFlag> ialign;
QMap<QModelIndex, Qt::CheckState> icheck;
};
#endif // QQTTABLEMODEL_H