• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • kdeedu
  • Sitemap
  • Contact Us
 

parley

LessonModel Class Reference

Model for the tree of lessons. More...

#include <lessonmodel.h>

Inheritance diagram for LessonModel:
Inheritance graph
[legend]

List of all members.

Public Types

enum  SplitLessonOrder { Sorted, Random }

Public Member Functions

 LessonModel (QObject *parent=0)
virtual QVariant data (const QModelIndex &index, int role) const
virtual Qt::ItemFlags flags (const QModelIndex &index) const
virtual bool setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
void splitLesson (const QModelIndex &containerIndex, int entriesPerLesson, SplitLessonOrder order)

Protected Member Functions

KEduVocContainer * rootContainer () const

Detailed Description

Model for the tree of lessons.

Definition at line 25 of file lessonmodel.h.


Member Enumeration Documentation

enum LessonModel::SplitLessonOrder

When splitting a lesson into smaller ones - how to sort the entries into lessons.

Enumerator:
Sorted 

The order of the entries in the document.

Random 

Randomized.

Definition at line 31 of file lessonmodel.h.


Constructor & Destructor Documentation

LessonModel::LessonModel ( QObject *  parent = 0  )  [explicit]

Definition at line 29 of file lessonmodel.cpp.


Member Function Documentation

QVariant LessonModel::data ( const QModelIndex &  index,
int  role 
) const [virtual]

Reimplemented from ContainerModel.

Definition at line 54 of file lessonmodel.cpp.

Qt::ItemFlags LessonModel::flags ( const QModelIndex &  index  )  const [virtual]

Reimplemented from ContainerModel.

Definition at line 42 of file lessonmodel.cpp.

KEduVocContainer * LessonModel::rootContainer (  )  const [protected, virtual]

Implements BasicContainerModel.

Definition at line 34 of file lessonmodel.cpp.

bool LessonModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role = Qt::EditRole 
) [virtual]

Change the name or checkbox of a lesson.

Parameters:
index which lesson
value new name
role 
Returns:
bool true it worked

Reimplemented from ContainerModel.

Definition at line 72 of file lessonmodel.cpp.

void LessonModel::splitLesson ( const QModelIndex &  containerIndex,
int  entriesPerLesson,
SplitLessonOrder  order 
)

Divide a lesson into smaller ones.

Tip: If you create a lesson that is >= the original one and use random order, you get your lesson reshuffled. Maybe that is sometimes useful. For now the lessons are appended at the end.

Parameters:
lessonIndex lesson to split
entriesPerLesson number of entries in each new lesson
order one of SplitLessonOrder

Definition at line 83 of file lessonmodel.cpp.


The documentation for this class was generated from the following files:
  • lessonmodel.h
  • lessonmodel.cpp

parley

Skip menu "parley"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdeedu

Skip menu "kdeedu"
  •     lib
  • kalzium
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  •   stepcore
Generated for kdeedu by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal