26 #if defined (HAVE_CONFIG_H)
32 #include <QFileIconProvider>
33 #include <QtAlgorithms>
54 val = QVariant (
f.fileName ());
58 val = QVariant (
f.absolutePath ());
71 left.toString ().compare (right.toString (), Qt::CaseInsensitive) < 0;
77 QVariant rightval =
getValue (right);
82 return !
lessThan (leftval, rightval);
109 beginInsertRows (QModelIndex (),
m_files.size (),
m_files.size ());
116 if (less_than (info, *it))
141 if (role == Qt::DisplayRole)
143 switch (idx.column ())
157 else if (role == Qt::DecorationRole)
159 switch (idx.column ())
174 Qt::Orientation orientation,
177 return ((orientation == Qt::Horizontal && role == Qt::DisplayRole)
185 if (order == Qt::DescendingOrder)
206 return p.isValid () ?
m_files[p.row ()] : QFileInfo ();
211 QFileIconProvider icon_provider;
213 return p.isValid () ? icon_provider.icon (
m_files[p.row ()]) : QIcon ();
QVariant getValue(const QFileInfo &f) const
find_file_less_than(int ord)
bool lessThan(const QVariant &left, const QVariant &right) const
bool operator()(const QFileInfo &left, const QFileInfo &right) const
void sort(int column, Qt::SortOrder order=Qt::AscendingOrder)
QVariant data(const QModelIndex &idx, int role) const
QFileInfo fileInfo(const QModelIndex &p) const
QIcon fileIcon(const QModelIndex &p) const
QList< QFileInfo > m_files
void addFile(const QFileInfo &info)
int rowCount(const QModelIndex &p=QModelIndex()) const
find_files_model(QObject *p=nullptr)
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
QStringList m_columnNames
int columnCount(const QModelIndex &p=QModelIndex()) const
static double f(double k, double l_nu, double c_pm)
octave_value::octave_value(const Array< char > &chm, char type) return retval