Quark  0.1
SearchPathModel.h++
Go to the documentation of this file.
1 
2 #ifndef __libquark_gui_SearchPathModel_hxx
3 #define __libquark_gui_SearchPathModel_hxx
4 
5 #include <QtCore/QString>
6 
8 
9 namespace quark {
10 namespace gui {
11 
21 {
22  Q_OBJECT;
23 
24  public:
25 
32  SearchPathModel(const QString &settingName, QObject *parent = NULL);
33 
35  virtual ~SearchPathModel();
36 
38  bool containsDirectory(const QString &dir) const;
39 
47  QString findFile(const QString &filename) const;
48 
49  public slots:
50 
52  void load();
53 
55  void save();
56 
57  protected:
58 
59  virtual QVariant getFieldValue(const QString &item, int field) const;
60  virtual QIcon getIcon(const QString &item) const;
61 
62  private:
63 
64  QString _settingName;
65  QIcon _icon;
66  bool _loaded;
67 };
68 
69 } // namespace gui
70 } // namespace quark
71 
72 #endif // __libquark_gui_SearchPathModel_hxx
SearchPathModel(const QString &settingName, QObject *parent=NULL)
Constructs a new SearchPathModel with the given setting name.
void save()
Writes the model&#39;s data to the settings.
QString findFile(const QString &filename) const
Searches for a file with the given name within each of the directories in the search path...
An implementation of BasicTableModel that represents a file search path, that is, a list of directori...
Definition: SearchPathModel.h++:20
virtual QVariant getFieldValue(const QString &item, int field) const
Returns the value of the given field of an object.
bool containsDirectory(const QString &dir) const
Tests if the model contains a given directory.
Definition: BarChartView.h++:6
A partial implementation of AbstractTableModel that stores its elements in a QVector.
Definition: BasicTableModel.h++:17
virtual QIcon getIcon(const QString &item) const
Returns the icon for a given item, if any.
void load()
Loads the model&#39;s data from the settings.
virtual QModelIndex parent(const QModelIndex &index) const
Specified by QAbstractItemModel.
virtual ~SearchPathModel()
Destructor.