GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
find-files-model.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2013-2018 John Donoghue
4 
5 This file is part of Octave.
6 
7 Octave is free software: you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <https://www.gnu.org/licenses/>.
20 
21 */
22 #if ! defined (octave_find_files_model_h)
23 #define octave_find_files_model_h 1
24 
25 #include <QAbstractListModel>
26 #include <QStringList>
27 #include <QList>
28 #include <QFileInfo>
29 #include <QIcon>
30 
31 namespace octave
32 {
34  {
35  Q_OBJECT
36 
37  public:
38 
39  find_files_model (QObject *p = nullptr);
40 
41  ~find_files_model (void) = default;
42 
43  void clear (void);
44 
45  void addFile (const QFileInfo& info);
46 
47  int rowCount (const QModelIndex& p = QModelIndex ()) const;
48 
49  int columnCount (const QModelIndex& p = QModelIndex ()) const;
50 
51  QVariant data (const QModelIndex& idx, int role) const;
52 
53  QVariant headerData (int section, Qt::Orientation orientation,
54  int role = Qt::DisplayRole) const;
55 
56  void sort (int column, Qt::SortOrder order = Qt::AscendingOrder);
57 
58  QFileInfo fileInfo (const QModelIndex& p) const;
59 
60  QIcon fileIcon (const QModelIndex& p) const;
61 
62  private:
63 
65  QStringList m_columnNames;
67  };
68 }
69 
70 #endif
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
OCTAVE_EXPORT octave_value_list column
Definition: sparse.cc:123
void addFile(const QFileInfo &info)
QIcon fileIcon(const QModelIndex &p) const
int columnCount(const QModelIndex &p=QModelIndex()) const
void sort(int column, Qt::SortOrder order=Qt::AscendingOrder)
QFileInfo fileInfo(const QModelIndex &p) const
QList< QFileInfo > m_files
QVariant data(const QModelIndex &idx, int role) const
~find_files_model(void)=default
find_files_model(QObject *p=nullptr)
p
Definition: lu.cc:138
int rowCount(const QModelIndex &p=QModelIndex()) const