Quark  0.1
BasicTreeModelBase.h++
Go to the documentation of this file.
1 #ifndef __libquark_gui_BasicTreeModelBase_hxx
2 #define __libquark_gui_BasicTreeModelBase_hxx
3 
4 #include <QAbstractItemModel>
5 #include <QFlags>
6 #include <QVector>
7 
8 #include <quark/Field.h++>
9 
10 namespace quark {
11 namespace gui {
12 
13 class LIBQUARK_API BasicTreeModelBase : public QAbstractItemModel
14 {
15  Q_OBJECT;
16 
17  public:
18 
19  enum Option { None = 0,
20  Sorted = 1 << 0,
21  RootVisible = 1 << 1 };
22 
23  Q_DECLARE_FLAGS(Options, Option);
24 
25  virtual ~BasicTreeModelBase();
26 
27  bool isSorted() const;
28  bool isRootVisible() const;
29 
30  int fieldCount() const;
31  const Field& getField(int field) const;
32 
33  QString getFieldName(int field) const;
34 
35  protected:
36 
37  BasicTreeModelBase(Options options = 0, QObject *parent = NULL);
38 
39  Field& addField(const QString &name);
40 
41  private:
42 
43  Options _options;
44  QVector<Field> _fields;
45 };
46 
47 } // namespace gui
48 } // namespace quark
49 
50 Q_DECLARE_OPERATORS_FOR_FLAGS(quark::gui::BasicTreeModelBase::Options);
51 
52 #endif // __libquark_gui_BasicTreeModelBase_hxx
Option
Definition: BasicTreeModelBase.h++:19
A class representing a field (a column) in a Quark table model.
Definition: Field.h++:17
Definition: BasicTreeModelBase.h++:13
Definition: BarChartView.h++:6
Q_DECLARE_OPERATORS_FOR_FLAGS(quark::gui::BasicTreeModelBase::Options)
#define LIBQUARK_API
Definition: Quark.h++:18