mirror of
https://github.com/epasveer/seer.git
synced 2026-08-30 00:50:42 +08:00
29 lines
696 B
C++
29 lines
696 B
C++
|
|
#pragma once
|
||
|
|
|
||
|
|
#include <QtWidgets/QFileSystemModel>
|
||
|
|
#include <QtCore/QSortFilterProxyModel>
|
||
|
|
#include <QtCore/QDebug>
|
||
|
|
|
||
|
|
class SeerExecutableFilterProxyModel : public QSortFilterProxyModel {
|
||
|
|
|
||
|
|
bool filterAcceptsRow (int sourceRow, const QModelIndex& sourceParent) const {
|
||
|
|
|
||
|
|
QFileSystemModel* fileModel = qobject_cast<QFileSystemModel*>(sourceModel());
|
||
|
|
|
||
|
|
QFileInfo file(fileModel->filePath(sourceModel()->index(sourceRow, 0, sourceParent)));
|
||
|
|
|
||
|
|
/*
|
||
|
|
if (fileModel != NULL) {
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
*/
|
||
|
|
|
||
|
|
if (file.isExecutable() == true || file.isHidden()) {
|
||
|
|
return true;
|
||
|
|
}else{
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
};
|
||
|
|
|