00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef MODEL_GRAPHLAYERS_H
00021 #define MODEL_GRAPHLAYERS_H
00022
00023 #include <QAbstractListModel>
00024
00025 class QModelIndex;
00026
00027 class GraphDocument;
00028 class Graph;
00029
00030
00031 class GraphLayersModel : public QAbstractListModel
00032 {
00033 Q_OBJECT
00034 public:
00038 explicit GraphLayersModel( GraphDocument* document, QObject* parent = 0 );
00039
00043 int rowCount( const QModelIndex& parent = QModelIndex() ) const;
00044
00049 QVariant data( const QModelIndex& index, int role ) const;
00050
00056 QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
00057
00061 Qt::ItemFlags flags( const QModelIndex& index ) const;
00062
00068 bool setData( const QModelIndex& index, const QVariant& value, int role = Qt::EditRole );
00069
00075 bool insertRows( int position, int type, const QModelIndex& index = QModelIndex() );
00076
00082 bool removeRows( int position, int rows, const QModelIndex& index = QModelIndex() );
00083
00087 Graph* at( const QModelIndex& index );
00088
00089 private:
00090 GraphDocument* _document;
00091
00092 };
00093
00094 #endif