ExerciseModel Class Reference

this model is for the ExerciseSelectionView -> it is the left TreeView, where pupils can choose an exercise or task More...

#include <exercisemodel.h>

Collaboration diagram for ExerciseModel:

Collaboration graph
[legend]

List of all members.

Signals

void printError (QString)
void setSelection (uint, int)
void resetView ()

Public Member Functions

 ExerciseModel (bool exercise, DataProject *project=0, QAbstractItemModel *parent=0)
Qt::ItemFlags flags (const QModelIndex &index) const
QVariant headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const
QModelIndex parent (const QModelIndex &index) const
int rowCount (const QModelIndex &parent=QModelIndex()) const
int columnCount (const QModelIndex &parent=QModelIndex()) const
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
void addChapter (QString chapterName, uint chapterId)
void addExercise (QString chapterName, QString exerciseName, uint exerciseId, DataExerciseStatus status)
void addOtherExercises (uint chapterId, ExerciseItem *oldExercise)
bool existsChapter (QString chapterName)
bool existsExercise (QString chapterName, QString exerciseName)
void editState (QString exerciseName, int exerciseId, DataExerciseStatus state)
void replaceChapterName (ExerciseItem *oldChapter, QString name)
void replaceExerciseName (ExerciseItem *oldExercise, QString name)
void removeChapterByName (QString chapterName)
void removeExerciseByName (QString chapterName, QString exerciseName, uint chapterId=0)
void editChapter (QString oldChap, QString newChap)
void removeChapter (int chapterID, QString chapterName)
void removeExercise (ExerciseItem *chapter, QString exerciseName)
int chapterID (QString chapterName)
QString chapterName (uint chapterId)
ExerciseItemchapter (uint chapterId, QString name)
ExerciseItemchapterByName (QString name)
ExerciseItemchapterById (uint chapterId)
uint maxChapterID ()
uint maxExerciseIdByChapterId (uint chapterId)
uint maxExerciseIdByChapterName (QString chapterName)
ExerciseItemgetExercise (QString chapterName, QString exerciseName) const
ExerciseItemgetItemByName (QString name) const
ExerciseItemgetRootItem ()
void setTeacher (bool state)
void drawTreeOnDebugOutput ()
void setPrintDialogUser (bool used)


Detailed Description

this model is for the ExerciseSelectionView -> it is the left TreeView, where pupils can choose an exercise or task

chapter -> Name QMap -> chapterId Exercise -> Name QMap -> exerciseId -> chapterId -> state

Definition at line 29 of file exercisemodel.h.


Constructor & Destructor Documentation

ExerciseModel::ExerciseModel ( bool  exercise,
DataProject project = 0,
QAbstractItemModel *  parent = 0 
)

Definition at line 4 of file exercisemodel.cpp.

Here is the call graph for this function:


Member Function Documentation

void ExerciseModel::addChapter ( QString  chapterName,
uint  chapterId 
)

Definition at line 287 of file exercisemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ExerciseModel::addExercise ( QString  chapterName,
QString  exerciseName,
uint  exerciseId,
DataExerciseStatus  status 
)

Definition at line 312 of file exercisemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ExerciseModel::addOtherExercises ( uint  chapterId,
ExerciseItem oldExercise 
)

Definition at line 342 of file exercisemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

ExerciseItem* ExerciseModel::chapter ( uint  chapterId,
QString  name 
)

Here is the caller graph for this function:

ExerciseItem * ExerciseModel::chapterById ( uint  chapterId  ) 

Definition at line 495 of file exercisemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

ExerciseItem * ExerciseModel::chapterByName ( QString  name  ) 

Definition at line 508 of file exercisemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int ExerciseModel::chapterID ( QString  chapterName  ) 

Definition at line 521 of file exercisemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QString ExerciseModel::chapterName ( uint  chapterId  ) 

Definition at line 535 of file exercisemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int ExerciseModel::columnCount ( const QModelIndex &  parent = QModelIndex()  )  const

Definition at line 146 of file exercisemodel.cpp.

Here is the call graph for this function:

QVariant ExerciseModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const

Definition at line 158 of file exercisemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ExerciseModel::drawTreeOnDebugOutput (  ) 

Definition at line 604 of file exercisemodel.cpp.

Here is the call graph for this function:

void ExerciseModel::editChapter ( QString  oldChap,
QString  newChap 
)

void ExerciseModel::editState ( QString  exerciseName,
int  exerciseId,
DataExerciseStatus  state 
)

Definition at line 421 of file exercisemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool ExerciseModel::existsChapter ( QString  chapterName  ) 

Definition at line 540 of file exercisemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool ExerciseModel::existsExercise ( QString  chapterName,
QString  exerciseName 
)

Definition at line 554 of file exercisemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 37 of file exercisemodel.cpp.

ExerciseItem * ExerciseModel::getExercise ( QString  chapterName,
QString  exerciseName 
) const

Definition at line 582 of file exercisemodel.cpp.

Here is the call graph for this function:

ExerciseItem * ExerciseModel::getItemByName ( QString  name  )  const

Definition at line 623 of file exercisemodel.cpp.

Here is the call graph for this function:

ExerciseItem* ExerciseModel::getRootItem (  )  [inline]

Definition at line 74 of file exercisemodel.h.

Here is the caller graph for this function:

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

Definition at line 62 of file exercisemodel.cpp.

Here is the call graph for this function:

QModelIndex ExerciseModel::index ( int  row,
int  column,
const QModelIndex &  parent = QModelIndex() 
) const

Definition at line 73 of file exercisemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

uint ExerciseModel::maxChapterID (  )  [inline]

Definition at line 68 of file exercisemodel.h.

Here is the caller graph for this function:

uint ExerciseModel::maxExerciseIdByChapterId ( uint  chapterId  ) 

Definition at line 370 of file exercisemodel.cpp.

Here is the call graph for this function:

uint ExerciseModel::maxExerciseIdByChapterName ( QString  chapterName  ) 

Definition at line 376 of file exercisemodel.cpp.

Here is the call graph for this function:

QModelIndex ExerciseModel::parent ( const QModelIndex &  index  )  const

Definition at line 101 of file exercisemodel.cpp.

Here is the call graph for this function:

void ExerciseModel::printError ( QString   )  [signal]

Here is the caller graph for this function:

void ExerciseModel::removeChapter ( int  chapterID,
QString  chapterName 
)

Definition at line 467 of file exercisemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ExerciseModel::removeChapterByName ( QString  chapterName  ) 

Definition at line 443 of file exercisemodel.cpp.

Here is the call graph for this function:

void ExerciseModel::removeExercise ( ExerciseItem chapter,
QString  exerciseName 
)

Definition at line 481 of file exercisemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ExerciseModel::removeExerciseByName ( QString  chapterName,
QString  exerciseName,
uint  chapterId = 0 
)

Definition at line 451 of file exercisemodel.cpp.

Here is the call graph for this function:

void ExerciseModel::replaceChapterName ( ExerciseItem oldChapter,
QString  name 
)

Definition at line 382 of file exercisemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ExerciseModel::replaceExerciseName ( ExerciseItem oldExercise,
QString  name 
)

Definition at line 400 of file exercisemodel.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void ExerciseModel::resetView (  )  [signal]

Here is the caller graph for this function:

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

Definition at line 127 of file exercisemodel.cpp.

Here is the call graph for this function:

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

Definition at line 212 of file exercisemodel.cpp.

Here is the call graph for this function:

void ExerciseModel::setPrintDialogUser ( bool  used  )  [inline]

Definition at line 78 of file exercisemodel.h.

Here is the caller graph for this function:

void ExerciseModel::setSelection ( uint  ,
int   
) [signal]

Here is the caller graph for this function:

void ExerciseModel::setTeacher ( bool  state  )  [inline]

Definition at line 75 of file exercisemodel.h.

Here is the caller graph for this function:


The documentation for this class was generated from the following files:

Generated on Mon Jun 15 15:39:49 2009 for Allevo II Doublebookkeeping by  doxygen 1.5.9