27 #include <QFileIconProvider>
28 #include <QtAlgorithms>
47 val = QVariant (f.fileName ());
51 val = QVariant (f.absolutePath ());
62 left.toString ().compare (right.toString (), Qt::CaseInsensitive) < 0;
67 QVariant rightval =
getValue (right);
72 return !
lessThan (leftval, rightval);
104 beginInsertRows (QModelIndex (),
_files.size (),
_files.size ());
111 if (less_than (info, *it))
break;
138 if (role == Qt::DisplayRole)
140 switch (idx.column ())
143 retval = QVariant (
_files[idx.row ()].fileName ());
147 retval = QVariant (
_files[idx.row ()].absolutePath ());
154 else if (role == Qt:: DecorationRole)
156 switch (idx.column ())
173 if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
184 if (order == Qt::DescendingOrder)
213 QFileIconProvider icon_provider;
216 return icon_provider.icon (
_files[p.row ()]);
bool lessThan(const QVariant &left, const QVariant &right) const
bool operator()(const QFileInfo &left, const QFileInfo &right) const
QVariant data(const QModelIndex &idx, int role) const
QIcon fileIcon(const QModelIndex &p) const
find_files_model(QObject *p=0)
F77_RET_T const double const double * f
QVariant getValue(const QFileInfo &f) const
int rowCount(const QModelIndex &p=QModelIndex()) const
void addFile(const QFileInfo &info)
int columnCount(const QModelIndex &p=QModelIndex()) const
find_file_less_than(int ord)
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
QFileInfo fileInfo(const QModelIndex &p) const
void sort(int column, Qt::SortOrder order=Qt::AscendingOrder)
QList< QFileInfo > _files