1 #ifndef _SEQUENCE_LOCATION_MODEL_HPP_
2 #define _SEQUENCE_LOCATION_MODEL_HPP_
4 #include <QAbstractTableModel>
5 #include "alg/sequence_location.hpp"
8 class SequenceLocationModel : public QAbstractTableModel
13 SequenceLocationModel(QObject *parent = 0);
15 typedef std::vector<SequenceLocation> model_type;
16 typedef model_type::size_type size_type;
17 typedef model_type::iterator iterator;
18 typedef model_type::const_iterator const_iterator;
19 //! \defgroup VectorInterface
20 //! \addtogroup VectorInterface
22 //! assign num copies of val to our vector
23 void assign(size_type num, const SequenceLocation& val);
24 //! return a specific element
25 SequenceLocation& at(size_type index);
26 //! return the last element
27 SequenceLocation& back();
28 //! return an iterator to the beginning of the model
30 //! return an iterator to the beginning of the model
31 const_iterator begin() const;
32 //! return an iterator to the end of the model
34 //! return an iterator to the end of the model
35 const_iterator end() const;
36 //! is the model empty?
38 //! return a specific element
39 SequenceLocation& operator[](size_type index);
40 //! remove the last element from our model
42 //! add a sequence location to the end of our model
43 void push_back(SequenceLocation&);
44 //! how many elements are in our model.
45 size_type size() const;
48 //! \defgroup QtModelInterface
49 //! \addtogroup QtModel
51 int rowCount(const QModelIndex& parent=QModelIndex()) const;
52 int columnCount(const QModelIndex& parent=QModelIndex()) const;
53 QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const;
55 QVariant headerData(int section, Qt::Orientation orentation, int role=Qt::DisplayRole);
57 //bool setData(const QModelIndex& index, const QVariant &value,
58 // int role=Qt::EditRole);
59 //Qt::ItemFlags flags(const QModelIndex& index) const;
61 //bool insertRows(int row, int count,
62 // const QModelIndex& parent=QModelIndex());
63 //bool removeRows(int row, int count);
64 // const QModelIndex& parent=QModelIndex());
67 model_type sequence_locations;