1 #ifndef _SEQUENCE_PROPERTIES_MODEL_HPP_
2 #define _SEQUENCE_PROPERTIES_MODEL_HPP_
5 #include <QAbstractTableModel>
8 #include "alg/glsequence.hpp"
10 class SequencePropertiesModel : public QAbstractTableModel
15 typedef boost::shared_ptr<GlSequence> model_item;
16 typedef std::vector<model_item> model_type;
17 typedef model_type::size_type size_type;
18 typedef model_type::iterator iterator;
19 typedef model_type::const_iterator const_iterator;
21 SequencePropertiesModel(model_type& model, QObject *parent = 0);
23 //! \defgroup VectorInterface
24 //! \addtogroup VectorInterface
26 //! assign num copies of val to our vector
27 void assign(size_type num, const model_item val);
28 //! return a specific element
29 model_item at(size_type index);
30 //! return the last element
32 //! return an iterator to the beginning of the model
34 //! return an iterator to the beginning of the model
35 const_iterator begin() const;
38 //! return an iterator to the end of the model
40 //! return an iterator to the end of the model
41 const_iterator end() const;
42 //! is the model empty?
44 //! return a specific element
45 model_item operator[](size_type index);
46 //! remove the last element from our model
48 //! add a sequence to the end of our model
49 void push_back(model_item);
50 //! how many elements are in our model.
51 size_type size() const;
54 //! \defgroup QtModelInterface
55 //! \addtogroup QtModel
57 int rowCount(const QModelIndex& parent=QModelIndex()) const;
58 int columnCount(const QModelIndex& parent=QModelIndex()) const;
59 QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const;
61 QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const;
63 bool setData(const QModelIndex& index, const QVariant &value,
64 int role=Qt::EditRole);
65 Qt::ItemFlags flags(const QModelIndex& index) const;
67 //bool insertRows(int row, int count,
68 // const QModelIndex& parent=QModelIndex());
69 //bool removeRows(int row, int count,
70 // const QModelIndex& parent=QModelIndex());
74 model_type& original_sequences;