1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00
LibQQt/qqttablemodel.cpp

38 lines
780 B
C++
Raw Normal View History

2016-12-29 16:49:18 +08:00
#include "qqttablemodel.h"
QQTTableModel::QQTTableModel(QObject *parent, QSqlDatabase db):
QSqlRelationalTableModel(parent, db)
{
}
void QQTTableModel::query(QString filter)
{
setFilter(filter);
select();
}
QVariant QQTTableModel::data(const QModelIndex &index, int role) const
{
switch(role)
{
case Qt::TextAlignmentRole:
case Qt::DisplayRole:
case Qt::CheckStateRole:
default:
break;
}
return QSqlRelationalTableModel::data(index, role);
}
bool QQTTableModel::setData(const QModelIndex &index, const QVariant &value, int role)
{
return QSqlRelationalTableModel::setData(index, value, role);
}
Qt::ItemFlags QQTTableModel::flags(const QModelIndex &index) const
{
return QSqlRelationalTableModel::flags(index);
}