00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef MODEL_GRAPHDOCUMENT_H
00021 #define MODEL_GRAPHDOCUMENT_H
00022
00023 #include <QAbstractListModel>
00024 #include <QList>
00025
00026 class QModelIndex;
00027
00028 class GraphDocument;
00029
00030 class GraphDocumentModel : public QAbstractListModel
00031 {
00032 Q_OBJECT
00033 public:
00034 explicit GraphDocumentModel( QList< GraphDocument*>* documents, QObject* parent = 0 );
00035
00039 int rowCount( const QModelIndex& parent = QModelIndex() ) const;
00040
00045 QVariant data( const QModelIndex& index, int role ) const;
00046
00052 QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
00053
00057 Qt::ItemFlags flags( const QModelIndex& index ) const;
00058
00064 bool setData( const QModelIndex& index, const QVariant& value, int role = Qt::EditRole );
00065
00071 bool insertRows( int position, int rows, const QModelIndex& index = QModelIndex() );
00072
00078 bool removeRows( int position, int rows, const QModelIndex& index = QModelIndex() );
00079
00083 GraphDocument* at( const QModelIndex& index );
00084 private:
00085 QList< GraphDocument*>& _documents;
00086
00087 };
00088
00089 #endif