You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
586 B
C++
34 lines
586 B
C++
#include "itablemodel.h"
|
|
|
|
ITableModel::ITableModel(QObject *parent)
|
|
:QAbstractTableModel(parent)
|
|
{
|
|
|
|
}
|
|
|
|
void ITableModel::filter(const QString &filter)
|
|
{
|
|
handleFilter(filter);
|
|
}
|
|
|
|
void ITableModel::restore()
|
|
{
|
|
handleRestore();
|
|
}
|
|
|
|
Qt::ItemFlags ITableModel::flags(const QModelIndex &index) const
|
|
{
|
|
if (m_editableCols.contains(index.column()))
|
|
{
|
|
return Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled;
|
|
}
|
|
|
|
return QAbstractTableModel::flags(index);
|
|
}
|
|
|
|
void ITableModel::setEditableCols(const QList<int> cols)
|
|
{
|
|
m_editableCols = cols;
|
|
}
|
|
|