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.
prodejna/core/itablemodel.cpp

34 lines
610 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) | Qt::ItemIsDragEnabled;
}
void ITableModel::setEditableCols(const QList<int> cols)
{
m_editableCols = cols;
}