GraphDocumentModel Class Reference

#include <model_GraphDocument.h>

List of all members.

Public Member Functions

 GraphDocumentModel (QList< GraphDocument * > *documents, QObject *parent=0)
int rowCount (const QModelIndex &parent=QModelIndex()) const
QVariant data (const QModelIndex &index, int role) const
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
Qt::ItemFlags flags (const QModelIndex &index) const
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
bool insertRows (int position, int rows, const QModelIndex &index=QModelIndex())
bool removeRows (int position, int rows, const QModelIndex &index=QModelIndex())
GraphDocumentat (const QModelIndex &index)

Detailed Description

Definition at line 30 of file model_GraphDocument.h.


Constructor & Destructor Documentation

GraphDocumentModel::GraphDocumentModel ( QList< GraphDocument * > *  documents,
QObject parent = 0 
) [explicit]

Definition at line 27 of file model_GraphDocument.cpp.


Member Function Documentation

GraphDocument * GraphDocumentModel::at ( const QModelIndex &  index  ) 

select the graph at position index.

Parameters:
index the position of the graph that you want to select.
Returns:
the graph at position Index.

Definition at line 100 of file model_GraphDocument.cpp.

QVariant GraphDocumentModel::data ( const QModelIndex &  index,
int  role 
) const

Return the data of a item on the model.

Parameters:
index the position of the item.
Parameters:
role the kind of data that you're trying to get.
Returns:
the QVariant of the data.

Definition at line 38 of file model_GraphDocument.cpp.

Qt::ItemFlags GraphDocumentModel::flags ( const QModelIndex &  index  )  const

return the flags for some item in the model.

Parameters:
index the index of the item
Returns:
a Qt::ItemFlags of the item.

Definition at line 62 of file model_GraphDocument.cpp.

QVariant GraphDocumentModel::headerData ( int  section,
Qt::Orientation  orientation,
int  role = Qt::DisplayRole 
) const

some information that goes on the header.

Parameters:
section the place where the data will be.
Parameters:
orientation Horizontal or Vertical.
Parameters:
role defaulted to DisplayRole for displaying things.
Returns:
a QVariant containing the string of the header.

Definition at line 47 of file model_GraphDocument.cpp.

bool GraphDocumentModel::insertRows ( int  position,
int  rows,
const QModelIndex &  index = QModelIndex() 
)

This does not work as it should, it will insert ONE new row (not rows) to the model.

Parameters:
position the index that the data will be inserted.
Parameters:
rows number of rows to insert.
Parameters:
QModelIndex The position that the item will be inserted after.
Returns:
true if success, false otherwise.

Definition at line 82 of file model_GraphDocument.cpp.

bool GraphDocumentModel::removeRows ( int  position,
int  rows,
const QModelIndex &  index = QModelIndex() 
)

remmove n rows, from position to potion+rows from the model.

Parameters:
position the first position to remove anything.
Parameters:
rows the number of rows to remove.
Parameters:
QModelIndex not used.
Returns:
true if success, false otherwise.

Definition at line 92 of file model_GraphDocument.cpp.

int GraphDocumentModel::rowCount ( const QModelIndex &  parent = QModelIndex()  )  const

Gives the number of rows on the model.

Parameters:
parent a default constructed, unused, QModelIndex.
Returns:
the number of rows on the model.

Definition at line 33 of file model_GraphDocument.cpp.

bool GraphDocumentModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
)

changes the data on a item.

Parameters:
index the index of the item that will have it's data modified.
Parameters:
value the new value of the data.
Parameters:
role defaulted to Edit Role, if it's another, it does nothing.
Returns:
true if the data was changed, false if it wasn't.

Definition at line 71 of file model_GraphDocument.cpp.


The documentation for this class was generated from the following files:
Generated on Mon Dec 27 13:13:41 2010 for Gluon by  doxygen 1.6.3