|
|
|
@ -1,7 +1,8 @@
|
|
|
|
|
#include "pluginsproxymodel.hpp"
|
|
|
|
|
#include "datafilesmodel.hpp"
|
|
|
|
|
|
|
|
|
|
PluginsProxyModel::PluginsProxyModel(QObject *parent, QAbstractTableModel *model) :
|
|
|
|
|
QSortFilterProxyModel(parent)
|
|
|
|
|
PluginsProxyModel::PluginsProxyModel(QObject *parent, DataFilesModel *model) :
|
|
|
|
|
QSortFilterProxyModel(parent), mSourceModel (model)
|
|
|
|
|
{
|
|
|
|
|
setFilterRegExp(QString("addon"));
|
|
|
|
|
setFilterRole (Qt::UserRole);
|
|
|
|
@ -16,5 +17,16 @@ PluginsProxyModel::~PluginsProxyModel()
|
|
|
|
|
|
|
|
|
|
QVariant PluginsProxyModel::data(const QModelIndex &index, int role) const
|
|
|
|
|
{
|
|
|
|
|
switch (role)
|
|
|
|
|
{
|
|
|
|
|
case Qt::CheckStateRole:
|
|
|
|
|
{
|
|
|
|
|
if (index.column() != 0)
|
|
|
|
|
return QVariant();
|
|
|
|
|
|
|
|
|
|
return mSourceModel->checkState(index);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
return QSortFilterProxyModel::data (index, role);
|
|
|
|
|
}
|
|
|
|
|