26 #if defined (HAVE_CONFIG_H)
32 #include <QFileIconProvider>
33 #include <QtAlgorithms>
49 int col = (m_sortorder > 0) ? m_sortorder : -m_sortorder;
54 val = QVariant (
f.fileName ());
58 val = QVariant (
f.absolutePath ());
71 left.toString ().compare (right.toString (), Qt::CaseInsensitive) < 0;
74 bool operator () (
const QFileInfo&
left,
const QFileInfo& right)
const
76 QVariant leftval = getValue (
left);
77 QVariant rightval = getValue (right);
80 return lessThan (leftval, rightval);
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 ())
146 retval = QVariant (
m_files[idx.row ()].fileName ());
150 retval = QVariant (
m_files[idx.row ()].absolutePath ());
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 ();
bool lessThan(const QVariant &left, const QVariant &right) const
QVariant getValue(const QFileInfo &f) const
find_file_less_than(int ord)
QFileInfo fileInfo(const QModelIndex &p) const
QStringList m_columnNames
QIcon fileIcon(const QModelIndex &p) const
QVariant data(const QModelIndex &idx, int role) const
void addFile(const QFileInfo &info)
int columnCount(const QModelIndex &p=QModelIndex()) const
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
int rowCount(const QModelIndex &p=QModelIndex()) const
find_files_model(QObject *p=nullptr)
QList< QFileInfo > m_files
void sort(int column, Qt::SortOrder order=Qt::AscendingOrder)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
F77_RET_T const F77_DBLE const F77_DBLE * f